@@ -4,6 +4,8 @@ module.exports = {
4
4
es6 : true ,
5
5
} ,
6
6
extends : [
7
+ 'airbnb-base' ,
8
+ 'plugin:unicorn/recommended' ,
7
9
] ,
8
10
parserOptions : {
9
11
ecmaVersion : '2020' ,
@@ -17,43 +19,47 @@ module.exports = {
17
19
'/test/helpers' ,
18
20
] ,
19
21
rules : {
20
- indent : [ 'error' , 4 , { SwitchCase : 1 } ] ,
21
- 'keyword-spacing' : [ 'error' ] ,
22
- 'space-in-parens' : [ 'error' ] ,
23
- 'comma-spacing' : [ 'error' ] ,
24
- 'comma-style' : [ 'error' , 'last' , {
25
- // https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/style.js#L54
22
+ 'class-methods-use-this' : 'off' ,
23
+ 'comma-dangle' : [ 'error' , {
24
+ arrays : 'always-multiline' ,
25
+ objects : 'always-multiline' ,
26
+ functions : 'never' ,
27
+ imports : 'always-multiline' ,
28
+ exports : 'always-multiline' ,
29
+ } ] ,
30
+ 'consistent-return' : 'off' ,
31
+ curly : [ 'error' , 'all' ] ,
32
+ 'default-case' : 'off' ,
33
+ 'func-names' : 'off' ,
34
+ 'import/no-unresolved' : 'off' ,
35
+ 'import/prefer-default-export' : 'off' ,
36
+ indent : [ 'error' , 4 , {
37
+ SwitchCase : 1 ,
38
+ } ] ,
39
+ 'max-len' : 'off' ,
40
+ 'no-console' : 'off' ,
41
+ 'no-continue' : 'off' ,
42
+ 'no-lonely-if' : 'off' ,
43
+ 'no-multi-spaces' : [ 'error' , {
26
44
exceptions : {
27
- ArrayExpression : false ,
28
- ArrayPattern : false ,
29
- ArrowFunctionExpression : false ,
30
- CallExpression : false ,
31
- FunctionDeclaration : false ,
32
- FunctionExpression : false ,
33
- ImportDeclaration : false ,
34
- ObjectExpression : false ,
35
- ObjectPattern : false ,
36
- VariableDeclaration : false ,
37
- NewExpression : false ,
45
+ Property : true ,
46
+ VariableDeclarator : true ,
38
47
} ,
39
48
} ] ,
40
- 'space-before-function-paren' : [ 'error' , {
41
- named : 'never' ,
42
- anonymous : 'always' ,
43
- asyncArrow : 'always' ,
44
- } ] ,
45
- 'space-infix-ops' : [ 'error' ] ,
46
- 'array-bracket-spacing' : [ 'error' , 'never' ] ,
47
- 'object-curly-spacing' : [ 'error' , 'always' ] ,
48
- 'computed-property-spacing' : [ 'error' , 'never' ] ,
49
- 'space-before-blocks' : [ 'error' ] ,
50
- 'one-var-declaration-per-line' : [ 'error' , 'always' ] ,
51
- 'function-paren-newline' : [ 'error' , 'multiline-arguments' ] ,
49
+ 'no-nested-ternary' : 'off' ,
50
+ 'no-param-reassign' : 'off' ,
51
+ 'no-plusplus' : 'off' ,
52
+ 'no-restricted-syntax' : 'off' ,
53
+ 'no-underscore-dangle' : 'off' ,
54
+ 'no-unused-vars' : 'off' ,
55
+ 'object-shorthand' : [ 'error' , 'never' ] ,
52
56
'padding-line-between-statements' : [ 'error' , {
53
57
blankLine : 'always' ,
54
58
prev : '*' ,
55
59
next : [ 'continue' , 'break' , 'export' , 'return' , 'throw' ] ,
56
60
} ] ,
61
+ 'prefer-destructuring' : 'off' ,
62
+ 'prefer-template' : 'off' ,
57
63
'spaced-comment' : [ 'error' , 'always' , {
58
64
line : {
59
65
markers : [ '/' ] ,
@@ -65,47 +71,112 @@ module.exports = {
65
71
balanced : true ,
66
72
} ,
67
73
} ] ,
68
- 'padded-blocks' : [ 'error' , 'never' ] ,
69
- 'no-multiple-empty-lines' : [ 'error' , {
70
- max : 1 ,
71
- maxBOF : 0 ,
72
- maxEOF : 0 ,
73
- } ] ,
74
- 'no-multi-spaces' : [ 'error' , {
75
- exceptions : {
76
- Property : true ,
77
- VariableDeclarator : true ,
78
- } ,
79
- } ] ,
80
- 'brace-style' : [ 'error' ] ,
81
- curly : [ 'error' ] ,
82
- 'object-shorthand' : [ 'error' , 'never' ] ,
83
- 'object-curly-newline' : [ 'error' , {
84
- // https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/style.js#L395
85
- ObjectExpression : { minProperties : 4 , multiline : true , consistent : true } ,
86
- ObjectPattern : { minProperties : 4 , multiline : true , consistent : true } ,
87
- ImportDeclaration : { minProperties : 4 , multiline : true , consistent : true } ,
88
- ExportDeclaration : { minProperties : 4 , multiline : true , consistent : true } ,
89
- } ] ,
90
- 'operator-linebreak' : [ 'error' , 'before' , { overrides : { '=' : 'none' } } ] ,
91
- 'dot-notation' : [ 'error' , { allowKeywords : true } ] ,
92
- 'arrow-parens' : [ 'error' ] ,
93
- quotes : [ 'error' , 'single' , { avoidEscape : true } ] ,
94
- 'quote-props' : [ 'error' , 'as-needed' , {
95
- keywords : false ,
96
- numbers : false ,
97
- } ] ,
98
- 'comma-dangle' : [ 'error' , {
99
- arrays : 'always-multiline' ,
100
- objects : 'always-multiline' ,
101
- functions : 'never' ,
102
- imports : 'always-multiline' ,
103
- exports : 'always-multiline' ,
104
- } ] ,
105
- semi : [ 'error' ] ,
106
- 'no-extra-semi' : [ 'error' ] ,
107
- 'no-trailing-spaces' : [ 'error' ] ,
108
- 'array-callback-return' : [ 'error' , { allowImplicit : true } ] ,
74
+ strict : 'off' ,
75
+ 'unicorn/catch-error-name' : 'off' ,
76
+ 'unicorn/no-array-callback-reference' : 'off' ,
77
+ 'unicorn/no-lonely-if' : 'off' ,
78
+ 'unicorn/no-negated-condition' : 'off' ,
79
+ 'unicorn/no-null' : 'off' ,
80
+ 'unicorn/no-this-assignment' : 'off' ,
81
+ 'unicorn/numeric-separators-style' : 'off' ,
82
+ 'unicorn/prefer-array-some' : 'off' , // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2007
83
+ 'unicorn/prefer-module' : 'off' ,
84
+ 'unicorn/prevent-abbreviations' : 'off' ,
85
+ 'unicorn/switch-case-braces' : [ 'error' , 'avoid' ] ,
86
+ 'wrap-iife' : [ 'error' , 'inside' ] ,
87
+
88
+ // TODO rules to be removed/fixed in v2.10.0 as fixes are not compatible with IE11
89
+ 'guard-for-in' : 'off' , // refactor to "for of"
90
+ 'no-restricted-globals' : 'off' ,
91
+ 'no-restricted-properties' : 'off' ,
92
+ 'no-var' : 'off' , // https://github.com/fomantic/Fomantic-UI/pull/2584
93
+ 'one-var' : 'off' ,
94
+ 'prefer-const' : 'off' ,
95
+ 'prefer-exponentiation-operator' : 'off' ,
96
+ 'prefer-spread' : 'off' ,
97
+ 'semi-style' : 'off' ,
98
+ 'unicorn/no-array-for-each' : 'off' ,
99
+ 'unicorn/no-for-loop' : 'off' , // autofixes to "for of"
100
+ 'unicorn/prefer-code-point' : 'off' ,
101
+ 'unicorn/prefer-includes' : 'off' ,
102
+ 'unicorn/prefer-node-protocol' : 'off' , // needs Node 14+
103
+ 'unicorn/prefer-number-properties' : 'off' ,
104
+ 'unicorn/prefer-optional-catch-binding' : 'off' ,
105
+ 'unicorn/prefer-prototype-methods' : 'off' ,
106
+ 'unicorn/prefer-reflect-apply' : 'off' ,
107
+ 'unicorn/prefer-spread' : 'off' ,
108
+ 'unicorn/prefer-top-level-await' : 'off' , // needs Node 14+
109
+ 'vars-on-top' : 'off' ,
110
+
111
+ // TODO rules with a lot of errors to be fixed manually, fix in a separate PR
112
+ eqeqeq : 'off' , // about 300 errors to be fixed manually
113
+ 'global-require' : 'off' , // about 30 errors to be fixed manually
114
+ 'no-shadow' : 'off' , // about 220 errors to be fixed manually
115
+ 'prefer-arrow-callback' : 'off' , // about 350 errors (all autofixable)
116
+ 'prefer-rest-params' : 'off' , // about 180 errors to be fixed manually
117
+ 'unicorn/no-nested-ternary' : 'off' , // about 80 errors (except 14 nested ternary operators autofixable)
118
+
119
+ // TODO
120
+ 'import/extensions' : 'off' ,
121
+ 'import/no-dynamic-require' : 'off' ,
122
+ 'no-bitwise' : 'off' ,
123
+ 'no-cond-assign' : 'off' ,
124
+ 'no-else-return' : 'off' ,
125
+ 'no-empty' : 'off' ,
126
+ 'no-labels' : 'off' ,
127
+ 'no-loop-func' : 'off' ,
128
+ 'no-mixed-operators' : 'off' ,
129
+ 'no-multi-assign' : 'off' ,
130
+ 'no-new-func' : 'off' ,
131
+ 'no-path-concat' : 'off' ,
132
+ 'no-prototype-builtins' : 'off' ,
133
+ 'no-return-assign' : 'off' ,
134
+ 'no-self-assign' : 'off' ,
135
+ 'no-shadow-restricted-names' : 'off' ,
136
+ 'no-unused-expressions' : 'off' ,
137
+ 'no-use-before-define' : 'off' ,
138
+ 'no-useless-concat' : 'off' ,
139
+ 'no-useless-escape' : 'off' ,
140
+ radix : 'off' ,
141
+ 'unicorn/better-regex' : 'off' ,
142
+ 'unicorn/consistent-function-scoping' : 'off' ,
143
+ 'unicorn/empty-brace-spaces' : 'off' ,
144
+ 'unicorn/escape-case' : 'off' ,
145
+ 'unicorn/explicit-length-check' : 'off' ,
146
+ 'unicorn/new-for-builtins' : 'off' ,
147
+ 'unicorn/no-hex-escape' : 'off' ,
148
+ 'unicorn/no-instanceof-array' : 'off' ,
149
+ 'unicorn/no-process-exit' : 'off' ,
150
+ 'unicorn/no-typeof-undefined' : 'off' ,
151
+ 'unicorn/no-useless-switch-case' : 'off' ,
152
+ 'unicorn/no-useless-undefined' : 'off' ,
153
+ 'unicorn/prefer-array-find' : 'off' ,
154
+ 'unicorn/prefer-date-now' : 'off' ,
155
+ 'unicorn/prefer-default-parameters' : 'off' ,
156
+ 'unicorn/prefer-logical-operator-over-ternary' : 'off' ,
157
+ 'unicorn/prefer-native-coercion-functions' : 'off' ,
158
+ 'unicorn/prefer-negative-index' : 'off' ,
159
+ 'unicorn/prefer-regexp-test' : 'off' ,
160
+ 'unicorn/prefer-switch' : 'off' ,
161
+ 'unicorn/prefer-ternary' : 'off' ,
162
+
163
+ // TODO rare errors
164
+ 'arrow-body-style' : 'off' ,
165
+ 'block-scoped-var' : 'off' ,
166
+ 'import/no-extraneous-dependencies' : 'off' ,
167
+ 'import/order' : 'off' ,
168
+ 'new-cap' : 'off' ,
169
+ 'newline-per-chained-call' : 'off' ,
170
+ 'no-extra-boolean-cast' : 'off' ,
171
+ 'no-redeclare' : 'off' ,
172
+ 'no-unneeded-ternary' : 'off' ,
173
+ 'no-useless-return' : 'off' ,
174
+ 'operator-assignment' : 'off' ,
175
+ 'unicorn/no-console-spaces' : 'off' ,
176
+ yoda : 'off' ,
109
177
} ,
110
178
reportUnusedDisableDirectives : true ,
179
+ globals : {
180
+ jQuery : true ,
181
+ } ,
111
182
} ;
0 commit comments