-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbase.js
110 lines (81 loc) · 3.18 KB
/
base.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
module.exports = {
'extends': ['strict'],
'rules': {
// array format
'array-bracket-newline': ['error', 'never'],
'array-bracket-spacing': ['error', 'never'],
'array-element-newline': ['error', 'never'],
// require parens in arrow function arguments only when needed
'arrow-parens': ['error', 'as-needed'],
// Enforces Stroustrup style brace formatting
'brace-style': ['error'],
// Do not enforce camel case property names.
'camelcase': ['error', {
'properties': 'never',
}],
// require dangling commas
'comma-dangle': ['error', 'always-multiline'],
// TEMP: Disable the complexity rule for the time being.
'complexity': ['off'],
// prefer kebab-case for file names
'filenames/match-regex': [2, '^[0-9a-z-.]+$', true],
// blacklist certain identifiers to prevent them being used
'id-blacklist': ['off'],
// this option enforces minimum and maximum identifier lengths
// (variable names, property names etc.)
'id-length': ['off'],
// require identifiers to match the provided regular expression
// identifiers must always be camel cased, and never have two
// or more contiguous upper case characters.
// Alternatively they can be all uppercase.
'id-match': [
2, '^([A-Z_]{2,}|[A-Z]?[a-z]+([A-Z]{1,2}[a-z]+)*[A-Z]?|id|JSON|_|_.*|.*[Ii]ndexedDB|getMatchedCSSRules|.*SKU)$', {
// identifiers in properties are also checked
'properties': false,
},
],
// TEMP: Increase the allowed maximum number of function paramaters for the time being.
'max-params': ['error', 7],
// disable max-statements rule
'max-statements': ['off'],
// allow/disallow an empty newline after var statement
'newline-after-var': [2, 'always'],
// enforce newline after each call when chaining the calls
'newline-per-chained-call': ['off'],
// allow confusing arrow function returns when wrapped in parens.
'no-confusing-arrow': ['error', {
'allowParens': true,
}],
// allow inline comments
'no-inline-comments': ['off'],
// TEMP: Disable the chek of usage of this outside classes.
'no-invalid-this': ['off'],
// disallow the use of magic numbers
'no-magic-numbers': ['off'],
// disallow declaration of variables already declared in the outer scope (but allow err and res)
'no-shadow': ['error', {
'allow': ['err', 'res'],
}],
// allow/disallow dangling underscores in identifiers
'no-underscore-dangle': ['off'],
// allow fixme, todo etc.
'no-warning-comments': ['off'],
// allow padding at the top and bottom of blocks
'padded-blocks': ['off'],
// prefer destructuring for objects
'prefer-destructuring': ['error', {
array: false,
object: false,
}],
// don't prefer Reflect
'prefer-reflect': ['off'],
// require no semi colon
'semi': ['error', 'never'],
// Never require a space before function opening parenthesis
'space-before-function-paren': ['error', 'never'],
// disable use strict rule
'strict': ['off'],
// enforce spacing around embedded expressions of template strings
'template-curly-spacing': ['error', 'never'],
},
}