@cto.af/eslint-config 4.1.6 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all.js +19 -10
- package/allModule.js +5 -4
- package/ava.js +4 -4
- package/cjs.js +1 -3
- package/es6.js +5 -4
- package/globals.js +1 -3
- package/ignores.js +2 -3
- package/index.js +7 -5
- package/js.js +7 -7
- package/jsdoc.js +4 -4
- package/jsdoc_ts.js +1 -3
- package/json.js +15 -0
- package/markdown.js +2 -3
- package/mjs.js +1 -3
- package/mocha.js +2 -4
- package/module.js +1 -3
- package/package.json +11 -21
- package/rules/ava.js +36 -40
- package/rules/js.js +380 -383
- package/rules/jsdoc.js +67 -71
- package/rules/json.js +5 -0
- package/rules/ts.js +162 -166
- package/ts.js +8 -8
- package/eslint.config.mjs +0 -33
package/rules/js.js
CHANGED
|
@@ -1,391 +1,388 @@
|
|
|
1
|
-
|
|
1
|
+
export const rules = {
|
|
2
|
+
// [Possible Problems](https://eslint.org/docs/rules/#possible-problems)
|
|
3
|
+
'array-callback-return': ['error', {allowImplicit: true}],
|
|
4
|
+
'constructor-super': 'error',
|
|
5
|
+
'for-direction': 'error',
|
|
6
|
+
'getter-return': 'error',
|
|
7
|
+
'no-async-promise-executor': 'error',
|
|
8
|
+
'no-await-in-loop': 'off', // I'll figure these out myself.
|
|
9
|
+
'no-class-assign': 'error',
|
|
10
|
+
'no-compare-neg-zero': 'error',
|
|
11
|
+
'no-cond-assign': 'error',
|
|
12
|
+
'no-const-assign': 'error',
|
|
13
|
+
'no-constant-binary-expression': 'error',
|
|
14
|
+
'no-constant-condition': 'error',
|
|
15
|
+
'no-constructor-return': 'error',
|
|
16
|
+
'no-control-regex': 'error',
|
|
17
|
+
'no-debugger': 'error',
|
|
18
|
+
'no-dupe-args': 'error',
|
|
19
|
+
'no-dupe-class-members': 'error',
|
|
20
|
+
'no-dupe-else-if': 'error',
|
|
21
|
+
'no-dupe-keys': 'error',
|
|
22
|
+
'no-duplicate-case': 'error',
|
|
23
|
+
'no-duplicate-imports': 'error',
|
|
24
|
+
'no-empty-character-class': 'error',
|
|
25
|
+
'no-empty-pattern': 'error',
|
|
26
|
+
'no-ex-assign': 'error',
|
|
27
|
+
'no-fallthrough': 'error',
|
|
28
|
+
'no-func-assign': 'error',
|
|
29
|
+
'no-import-assign': 'error',
|
|
30
|
+
'no-inner-declarations': 'error',
|
|
31
|
+
'no-invalid-regexp': 'error',
|
|
32
|
+
'no-irregular-whitespace': 'error',
|
|
33
|
+
'no-loss-of-precision': 'error',
|
|
34
|
+
'no-misleading-character-class': 'error',
|
|
35
|
+
'no-new-native-nonconstructor': 'error',
|
|
36
|
+
'no-obj-calls': 'error',
|
|
37
|
+
'no-promise-executor-return': 'error',
|
|
38
|
+
'no-prototype-builtins': 'error',
|
|
39
|
+
'no-self-assign': 'error',
|
|
40
|
+
'no-self-compare': 'error',
|
|
41
|
+
'no-setter-return': 'error',
|
|
42
|
+
'no-sparse-arrays': 'error',
|
|
43
|
+
'no-template-curly-in-string': 'error',
|
|
44
|
+
'no-this-before-super': 'error',
|
|
45
|
+
'no-undef': 'error',
|
|
46
|
+
'no-unexpected-multiline': 'error',
|
|
47
|
+
'no-unmodified-loop-condition': 'error',
|
|
48
|
+
'no-unreachable': 'error',
|
|
49
|
+
'no-unreachable-loop': 'error',
|
|
50
|
+
'no-unsafe-finally': 'error',
|
|
51
|
+
'no-unsafe-negation': 'error',
|
|
52
|
+
'no-unsafe-optional-chaining': 'error',
|
|
53
|
+
'no-unused-private-class-members': 'error',
|
|
54
|
+
'no-unused-vars': [
|
|
55
|
+
'error', {
|
|
56
|
+
args: 'all',
|
|
57
|
+
argsIgnorePattern: '^_',
|
|
58
|
+
caughtErrors: 'all',
|
|
59
|
+
caughtErrorsIgnorePattern: '^(_|ignore)',
|
|
60
|
+
varsIgnorePattern: '^_[^_]',
|
|
61
|
+
reportUsedIgnorePattern: true,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
'no-use-before-define': 'error',
|
|
65
|
+
// Doesn't account for try blocks
|
|
66
|
+
// See https://github.com/eslint/eslint/issues/17579
|
|
67
|
+
'no-useless-assignment': 'off',
|
|
68
|
+
'no-useless-backreference': 'error',
|
|
69
|
+
'require-atomic-updates': 'error',
|
|
70
|
+
'use-isnan': 'error',
|
|
71
|
+
'valid-typeof': ['error', {requireStringLiterals: true}],
|
|
2
72
|
|
|
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
|
-
|
|
73
|
+
// [Suggestions](https://eslint.org/docs/rules/#suggestions)
|
|
74
|
+
'accessor-pairs': 'error',
|
|
75
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
76
|
+
'block-scoped-var': 'error',
|
|
77
|
+
'camelcase': 'off', // If I had started with this.
|
|
78
|
+
'capitalized-comments': ['error', 'always', {
|
|
79
|
+
ignoreConsecutiveComments: true,
|
|
80
|
+
ignorePattern: 'c8',
|
|
81
|
+
}],
|
|
82
|
+
'class-methods-use-this': 'warn',
|
|
83
|
+
// This one is pedantic even for me.
|
|
84
|
+
'complexity': 'off',
|
|
85
|
+
'consistent-return': 'error',
|
|
86
|
+
'consistent-this': 'off', // Not needed anymore with =>
|
|
87
|
+
'curly': ['error', 'multi-line'],
|
|
88
|
+
// I use exhastive cases a lot, which makes the default unreachable
|
|
89
|
+
'default-case': 'off',
|
|
90
|
+
'default-case-last': 'error',
|
|
91
|
+
'default-param-last': 'error',
|
|
92
|
+
'dot-notation': 'error',
|
|
93
|
+
'eqeqeq': ['error', 'always', {null: 'ignore'}],
|
|
94
|
+
'func-name-matching': 'error',
|
|
95
|
+
'func-names': ['error', 'as-needed'],
|
|
96
|
+
'func-style': ['error', 'declaration', {allowArrowFunctions: true}],
|
|
97
|
+
'grouped-accessor-pairs': 'error',
|
|
98
|
+
'guard-for-in': 'error',
|
|
99
|
+
'id-denylist': 'off', // Not needed
|
|
100
|
+
'id-length': 'off', // Not needed
|
|
101
|
+
'id-match': 'off', // Not needed
|
|
102
|
+
'init-declarations': 'error',
|
|
103
|
+
'logical-assignment-operators': 'off', // No.
|
|
104
|
+
'max-classes-per-file': 'off', // No.
|
|
105
|
+
'max-depth': 'off', // No.
|
|
106
|
+
'max-lines': 'off', // No.
|
|
107
|
+
'max-lines-per-function': 'off', // No.
|
|
108
|
+
'max-nested-callbacks': 'off', // No.
|
|
109
|
+
'max-params': ['error', 4],
|
|
110
|
+
'max-statements': 'off', // No.
|
|
111
|
+
'new-cap': 'error',
|
|
112
|
+
'no-alert': 'error',
|
|
113
|
+
'no-array-constructor': 'error',
|
|
114
|
+
'no-bitwise': 'off', // Lol. Not in these projects
|
|
115
|
+
'no-caller': 'error',
|
|
116
|
+
'no-case-declarations': 'error',
|
|
117
|
+
'no-console': 'error',
|
|
118
|
+
'no-continue': 'off', // Why?
|
|
119
|
+
'no-delete-var': 'error',
|
|
120
|
+
'no-div-regex': 'error',
|
|
121
|
+
'no-else-return': 'error',
|
|
122
|
+
'no-empty': 'error',
|
|
123
|
+
'no-empty-function': 'error',
|
|
124
|
+
'no-empty-static-block': 'error',
|
|
125
|
+
'no-eq-null': 'off', // I disagree with this one.
|
|
126
|
+
'no-eval': 'error',
|
|
127
|
+
'no-extend-native': 'error',
|
|
128
|
+
'no-extra-bind': 'error',
|
|
129
|
+
'no-extra-boolean-cast': 'error',
|
|
130
|
+
'no-extra-label': 'error',
|
|
131
|
+
'no-global-assign': 'error',
|
|
132
|
+
'no-implicit-coercion': 'error',
|
|
133
|
+
'no-implicit-globals': 'error',
|
|
134
|
+
'no-implied-eval': 'error',
|
|
135
|
+
'no-inline-comments': 'off', // Meta.
|
|
136
|
+
'no-invalid-this': 'error',
|
|
137
|
+
'no-iterator': 'error',
|
|
138
|
+
'no-label-var': 'error',
|
|
139
|
+
'no-labels': 'error',
|
|
140
|
+
'no-lone-blocks': 'error',
|
|
141
|
+
'no-lonely-if': 'error',
|
|
142
|
+
'no-loop-func': 'error',
|
|
143
|
+
'no-magic-numbers': 'off', // No shot at this for node-cbor. For other projects, yes.
|
|
144
|
+
'no-multi-assign': 'error',
|
|
145
|
+
'no-multi-str': 'error',
|
|
146
|
+
'no-negated-condition': 'error',
|
|
147
|
+
'no-nested-ternary': 'error',
|
|
148
|
+
'no-new': 'error',
|
|
149
|
+
'no-new-func': 'error',
|
|
150
|
+
'no-new-wrappers': 'warn',
|
|
151
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
152
|
+
'no-object-constructor': 'error',
|
|
153
|
+
'no-octal': 'error',
|
|
154
|
+
'no-octal-escape': 'warn',
|
|
155
|
+
'no-param-reassign': 'off', // I do this all the time.
|
|
156
|
+
'no-plusplus': 'off', // What?
|
|
157
|
+
'no-proto': 'error',
|
|
158
|
+
'no-redeclare': 'error',
|
|
159
|
+
'no-regex-spaces': 'error',
|
|
160
|
+
'no-restricted-exports': 'off', // Not needed
|
|
161
|
+
'no-restricted-globals': 'off', // Not needed
|
|
162
|
+
'no-restricted-imports': 'off', // Not needed
|
|
163
|
+
'no-restricted-properties': 'off', // Not needed
|
|
164
|
+
'no-restricted-syntax': 'off', // Not needed
|
|
165
|
+
'no-return-assign': 'error',
|
|
166
|
+
'no-script-url': 'error',
|
|
167
|
+
'no-sequences': 'error',
|
|
168
|
+
'no-shadow': 'error',
|
|
169
|
+
'no-shadow-restricted-names': 'error',
|
|
170
|
+
'no-ternary': 'off', // No.
|
|
171
|
+
'no-throw-literal': 'error',
|
|
172
|
+
'no-undef-init': 'off', // Turns out I need this often enough
|
|
173
|
+
'no-undefined': 'off', // No.
|
|
174
|
+
'no-underscore-dangle': 'off', // Maybe one day.
|
|
175
|
+
'no-unneeded-ternary': 'error',
|
|
176
|
+
'no-unused-expressions': ['error', {allowShortCircuit: true}],
|
|
177
|
+
'no-unused-labels': 'error',
|
|
178
|
+
'no-useless-call': 'error',
|
|
179
|
+
'no-useless-catch': 'error',
|
|
180
|
+
'no-useless-computed-key': 'error',
|
|
181
|
+
'no-useless-concat': 'error',
|
|
182
|
+
'no-useless-constructor': 'off', // I like useless constructors
|
|
183
|
+
'no-useless-escape': 'error',
|
|
184
|
+
'no-useless-rename': 'error',
|
|
185
|
+
'no-useless-return': 'error',
|
|
186
|
+
'no-var': 'error',
|
|
187
|
+
'no-void': 'error',
|
|
188
|
+
'no-warning-comments': 'off', // Only turn this on periodically
|
|
189
|
+
'no-with': 'error',
|
|
190
|
+
'object-shorthand': 'error',
|
|
191
|
+
'one-var': ['error', 'never'],
|
|
192
|
+
'operator-assignment': 'error',
|
|
193
|
+
'prefer-arrow-callback': 'error',
|
|
194
|
+
'prefer-const': 'error',
|
|
195
|
+
'prefer-destructuring': 'error',
|
|
196
|
+
'prefer-exponentiation-operator': 'error',
|
|
197
|
+
'prefer-named-capture-group': 'error',
|
|
198
|
+
'prefer-numeric-literals': 'error',
|
|
199
|
+
'prefer-object-has-own': 'off', // Not yet
|
|
200
|
+
'prefer-object-spread': 'error',
|
|
201
|
+
'prefer-promise-reject-errors': 'warn',
|
|
202
|
+
'prefer-regex-literals': 'error',
|
|
203
|
+
'prefer-rest-params': 'error',
|
|
204
|
+
'prefer-spread': 'error',
|
|
205
|
+
'prefer-template': 'error',
|
|
206
|
+
'radix': 'error',
|
|
207
|
+
'require-await': 'error',
|
|
208
|
+
'require-unicode-regexp': 'off', // No.
|
|
209
|
+
'require-yield': 'error',
|
|
210
|
+
'sort-imports': 'error',
|
|
211
|
+
'sort-keys': 'off', // Pedantic
|
|
212
|
+
'sort-vars': 'off', // Pedantic
|
|
213
|
+
'strict': ['error', 'global'],
|
|
214
|
+
'symbol-description': 'error',
|
|
215
|
+
'unicode-bom': 'error',
|
|
216
|
+
'vars-on-top': 'error',
|
|
217
|
+
'yoda': ['error', 'never', {exceptRange: true}],
|
|
75
218
|
|
|
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
|
-
'max-classes-per-file': 'off', // No.
|
|
108
|
-
'max-depth': 'off', // No.
|
|
109
|
-
'max-lines': 'off', // No.
|
|
110
|
-
'max-lines-per-function': 'off', // No.
|
|
111
|
-
'max-nested-callbacks': 'off', // No.
|
|
112
|
-
'max-params': ['error', 4],
|
|
113
|
-
'max-statements': 'off', // No.
|
|
114
|
-
'new-cap': 'error',
|
|
115
|
-
'no-alert': 'error',
|
|
116
|
-
'no-array-constructor': 'error',
|
|
117
|
-
'no-bitwise': 'off', // Lol. Not in these projects
|
|
118
|
-
'no-caller': 'error',
|
|
119
|
-
'no-case-declarations': 'error',
|
|
120
|
-
'no-console': 'error',
|
|
121
|
-
'no-continue': 'off', // Why?
|
|
122
|
-
'no-delete-var': 'error',
|
|
123
|
-
'no-div-regex': 'error',
|
|
124
|
-
'no-else-return': 'error',
|
|
125
|
-
'no-empty': 'error',
|
|
126
|
-
'no-empty-function': 'error',
|
|
127
|
-
'no-empty-static-block': 'error',
|
|
128
|
-
'no-eq-null': 'off', // I disagree with this one.
|
|
129
|
-
'no-eval': 'error',
|
|
130
|
-
'no-extend-native': 'error',
|
|
131
|
-
'no-extra-bind': 'error',
|
|
132
|
-
'no-extra-boolean-cast': 'error',
|
|
133
|
-
'no-extra-label': 'error',
|
|
134
|
-
'no-global-assign': 'error',
|
|
135
|
-
'no-implicit-coercion': 'error',
|
|
136
|
-
'no-implicit-globals': 'error',
|
|
137
|
-
'no-implied-eval': 'error',
|
|
138
|
-
'no-inline-comments': 'off', // Meta.
|
|
139
|
-
'no-invalid-this': 'error',
|
|
140
|
-
'no-iterator': 'error',
|
|
141
|
-
'no-label-var': 'error',
|
|
142
|
-
'no-labels': 'error',
|
|
143
|
-
'no-lone-blocks': 'error',
|
|
144
|
-
'no-lonely-if': 'error',
|
|
145
|
-
'no-loop-func': 'error',
|
|
146
|
-
'no-magic-numbers': 'off', // No shot at this for node-cbor. For other projects, yes.
|
|
147
|
-
'no-multi-assign': 'error',
|
|
148
|
-
'no-multi-str': 'error',
|
|
149
|
-
'no-negated-condition': 'error',
|
|
150
|
-
'no-nested-ternary': 'error',
|
|
151
|
-
'no-new': 'error',
|
|
152
|
-
'no-new-func': 'error',
|
|
153
|
-
'no-new-wrappers': 'warn',
|
|
154
|
-
'no-nonoctal-decimal-escape': 'error',
|
|
155
|
-
'no-object-constructor': 'error',
|
|
156
|
-
'no-octal': 'error',
|
|
157
|
-
'no-octal-escape': 'warn',
|
|
158
|
-
'no-param-reassign': 'off', // I do this all the time.
|
|
159
|
-
'no-plusplus': 'off', // What?
|
|
160
|
-
'no-proto': 'error',
|
|
161
|
-
'no-redeclare': 'error',
|
|
162
|
-
'no-regex-spaces': 'error',
|
|
163
|
-
'no-restricted-exports': 'off', // Not needed
|
|
164
|
-
'no-restricted-globals': 'off', // Not needed
|
|
165
|
-
'no-restricted-imports': 'off', // Not needed
|
|
166
|
-
'no-restricted-properties': 'off', // Not needed
|
|
167
|
-
'no-restricted-syntax': 'off', // Not needed
|
|
168
|
-
'no-return-assign': 'error',
|
|
169
|
-
'no-script-url': 'error',
|
|
170
|
-
'no-sequences': 'error',
|
|
171
|
-
'no-shadow': 'error',
|
|
172
|
-
'no-shadow-restricted-names': 'error',
|
|
173
|
-
'no-ternary': 'off', // No.
|
|
174
|
-
'no-throw-literal': 'error',
|
|
175
|
-
'no-undef-init': 'off', // Turns out I need this often enough
|
|
176
|
-
'no-undefined': 'off', // No.
|
|
177
|
-
'no-underscore-dangle': 'off', // Maybe one day.
|
|
178
|
-
'no-unneeded-ternary': 'error',
|
|
179
|
-
'no-unused-expressions': ['error', {allowShortCircuit: true}],
|
|
180
|
-
'no-unused-labels': 'error',
|
|
181
|
-
'no-useless-call': 'error',
|
|
182
|
-
'no-useless-catch': 'error',
|
|
183
|
-
'no-useless-computed-key': 'error',
|
|
184
|
-
'no-useless-concat': 'error',
|
|
185
|
-
'no-useless-constructor': 'off', // I like useless constructors
|
|
186
|
-
'no-useless-escape': 'error',
|
|
187
|
-
'no-useless-rename': 'error',
|
|
188
|
-
'no-useless-return': 'error',
|
|
189
|
-
'no-var': 'error',
|
|
190
|
-
'no-void': 'error',
|
|
191
|
-
'no-warning-comments': 'off', // Only turn this on periodically
|
|
192
|
-
'no-with': 'error',
|
|
193
|
-
'object-shorthand': 'error',
|
|
194
|
-
'one-var': ['error', 'never'],
|
|
195
|
-
'operator-assignment': 'error',
|
|
196
|
-
'prefer-arrow-callback': 'error',
|
|
197
|
-
'prefer-const': 'error',
|
|
198
|
-
'prefer-destructuring': 'error',
|
|
199
|
-
'prefer-exponentiation-operator': 'error',
|
|
200
|
-
'prefer-named-capture-group': 'error',
|
|
201
|
-
'prefer-numeric-literals': 'error',
|
|
202
|
-
'prefer-object-has-own': 'off', // Not yet
|
|
203
|
-
'prefer-object-spread': 'error',
|
|
204
|
-
'prefer-promise-reject-errors': 'warn',
|
|
205
|
-
'prefer-regex-literals': 'error',
|
|
206
|
-
'prefer-rest-params': 'error',
|
|
207
|
-
'prefer-spread': 'error',
|
|
208
|
-
'prefer-template': 'error',
|
|
209
|
-
'radix': 'error',
|
|
210
|
-
'require-await': 'error',
|
|
211
|
-
'require-unicode-regexp': 'off', // No.
|
|
212
|
-
'require-yield': 'error',
|
|
213
|
-
'sort-imports': 'error',
|
|
214
|
-
'sort-keys': 'off', // Pedantic
|
|
215
|
-
'sort-vars': 'off', // Pedantic
|
|
216
|
-
'strict': ['error', 'global'],
|
|
217
|
-
'symbol-description': 'error',
|
|
218
|
-
'unicode-bom': 'error',
|
|
219
|
-
'vars-on-top': 'error',
|
|
220
|
-
'yoda': ['error', 'never', {exceptRange: true}],
|
|
219
|
+
// [Stylistc](https://eslint.style/packages/default)
|
|
220
|
+
'@stylistic/array-bracket-newline': ['error', 'consistent'],
|
|
221
|
+
'@stylistic/array-bracket-spacing': ['error', 'never'],
|
|
222
|
+
'@stylistic/array-element-newline': ['error', 'consistent'],
|
|
223
|
+
'@stylistic/arrow-parens': ['error', 'as-needed'],
|
|
224
|
+
'@stylistic/arrow-spacing': 'error',
|
|
225
|
+
'@stylistic/block-spacing': ['error', 'always'],
|
|
226
|
+
'@stylistic/brace-style': ['error', '1tbs'],
|
|
227
|
+
'@stylistic/comma-dangle': ['error', {
|
|
228
|
+
arrays: 'always-multiline',
|
|
229
|
+
objects: 'always-multiline',
|
|
230
|
+
imports: 'always-multiline',
|
|
231
|
+
exports: 'always-multiline',
|
|
232
|
+
functions: 'never',
|
|
233
|
+
enums: 'always-multiline',
|
|
234
|
+
tuples: 'always-multiline',
|
|
235
|
+
}],
|
|
236
|
+
'@stylistic/comma-spacing': 'error',
|
|
237
|
+
'@stylistic/comma-style': ['error', 'last'],
|
|
238
|
+
'@stylistic/computed-property-spacing': 'error',
|
|
239
|
+
'@stylistic/curly-newline': 'off', // Too much config
|
|
240
|
+
'@stylistic/dot-location': ['error', 'property'],
|
|
241
|
+
'@stylistic/eol-last': 'error',
|
|
242
|
+
'@stylistic/func-call-spacing': 'off', // Renamed
|
|
243
|
+
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
244
|
+
'@stylistic/function-call-spacing': 'error',
|
|
245
|
+
'@stylistic/function-paren-newline': ['error', 'consistent'],
|
|
246
|
+
'@stylistic/generator-star-spacing': 'error',
|
|
247
|
+
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
248
|
+
'@stylistic/indent': ['error', 2, {SwitchCase: 1}],
|
|
249
|
+
'@stylistic/indent-binary-ops': 'off', // Not good enough
|
|
221
250
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
'@stylistic/dot-location': ['error', 'property'],
|
|
243
|
-
'@stylistic/eol-last': 'error',
|
|
244
|
-
'@stylistic/func-call-spacing': 'off', // Renamed
|
|
245
|
-
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
246
|
-
'@stylistic/function-call-spacing': 'error',
|
|
247
|
-
'@stylistic/function-paren-newline': ['error', 'consistent'],
|
|
248
|
-
'@stylistic/generator-star-spacing': 'error',
|
|
249
|
-
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
250
|
-
'@stylistic/indent': ['error', 2, {SwitchCase: 1}],
|
|
251
|
-
'@stylistic/indent-binary-ops': 'off', // Not good enough
|
|
251
|
+
'@stylistic/jsx-child-element-spacing': 'off', // Not needed
|
|
252
|
+
'@stylistic/jsx-closing-bracket-location': 'off', // Not needed
|
|
253
|
+
'@stylistic/jsx-closing-tag-location': 'off', // Not needed
|
|
254
|
+
'@stylistic/jsx-curly-brace-presence': 'off', // Not needed
|
|
255
|
+
'@stylistic/jsx-curly-newline': 'off', // Not needed
|
|
256
|
+
'@stylistic/jsx-curly-spacing': 'off', // Not needed
|
|
257
|
+
'@stylistic/jsx-equals-spacing': 'off', // Not needed
|
|
258
|
+
'@stylistic/jsx-first-prop-new-line': 'off', // Not needed
|
|
259
|
+
'@stylistic/jsx-function-call-newline': 'off', // Not needed
|
|
260
|
+
'@stylistic/jsx-indent-props': 'off', // Not needed
|
|
261
|
+
'@stylistic/jsx-max-props-per-line': 'off', // Not needed
|
|
262
|
+
'@stylistic/jsx-newline': 'off', // Not needed
|
|
263
|
+
'@stylistic/jsx-one-expression-per-line': 'off', // Not needed
|
|
264
|
+
'@stylistic/jsx-pascal-case': 'off', // Not needed
|
|
265
|
+
'@stylistic/jsx-props-no-multi-spaces': 'off', // Not needed
|
|
266
|
+
'@stylistic/jsx-quotes': 'off', // Not needed
|
|
267
|
+
'@stylistic/jsx-self-closing-comp': 'off', // Not needed
|
|
268
|
+
'@stylistic/jsx-sort-props': 'off', // Not needed
|
|
269
|
+
'@stylistic/jsx-tag-spacing': 'off', // Not needed
|
|
270
|
+
'@stylistic/jsx-wrap-multilines': 'off', // Not needed
|
|
252
271
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
'@stylistic/key-spacing': 'error',
|
|
273
|
+
'@stylistic/keyword-spacing': 'error',
|
|
274
|
+
'@stylistic/line-comment-position': 'off', // Too hard to change
|
|
275
|
+
'@stylistic/linebreak-style': 'error',
|
|
276
|
+
'@stylistic/lines-around-comment': ['error', {
|
|
277
|
+
allowArrayStart: true,
|
|
278
|
+
allowBlockStart: true,
|
|
279
|
+
allowClassStart: true,
|
|
280
|
+
allowEnumStart: true,
|
|
281
|
+
allowInterfaceStart: true,
|
|
282
|
+
allowObjectStart: true,
|
|
283
|
+
allowTypeStart: true,
|
|
284
|
+
}],
|
|
285
|
+
'@stylistic/lines-between-class-members': ['error', 'always', {
|
|
286
|
+
exceptAfterSingleLine: true,
|
|
287
|
+
}],
|
|
288
|
+
'@stylistic/max-len': ['error', 80, {
|
|
289
|
+
ignoreRegExpLiterals: true,
|
|
290
|
+
ignoreStrings: true,
|
|
291
|
+
ignoreTemplateLiterals: true,
|
|
292
|
+
ignoreUrls: true,
|
|
293
|
+
}],
|
|
294
|
+
'@stylistic/max-statements-per-line': 'off',
|
|
295
|
+
'@stylistic/member-delimiter-style': 'off',
|
|
296
|
+
'@stylistic/multiline-comment-style': 'off', // Not important
|
|
297
|
+
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
298
|
+
'@stylistic/new-parens': 'error',
|
|
299
|
+
'@stylistic/newline-per-chained-call': 'error',
|
|
300
|
+
'@stylistic/no-confusing-arrow': 'error',
|
|
301
|
+
'@stylistic/no-extra-parens': 'off', // Too fiddly to torn off everything.
|
|
302
|
+
'@stylistic/no-extra-semi': 'error',
|
|
303
|
+
'@stylistic/no-floating-decimal': 'error',
|
|
304
|
+
'@stylistic/no-mixed-operators': 'error',
|
|
305
|
+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
306
|
+
'@stylistic/no-multi-spaces': 'error',
|
|
307
|
+
'@stylistic/no-multiple-empty-lines': ['error', {max: 1}],
|
|
308
|
+
'@stylistic/no-tabs': 'error',
|
|
309
|
+
'@stylistic/no-trailing-spaces': 'error',
|
|
310
|
+
'@stylistic/no-whitespace-before-property': 'error',
|
|
311
|
+
'@stylistic/nonblock-statement-body-position': 'error',
|
|
312
|
+
'@stylistic/object-curly-newline': 'error',
|
|
313
|
+
'@stylistic/object-curly-spacing': ['error', 'never'],
|
|
314
|
+
'@stylistic/object-property-newline': ['error', {allowAllPropertiesOnSameLine: true}],
|
|
315
|
+
'@stylistic/one-var-declaration-per-line': 'error',
|
|
316
|
+
'@stylistic/operator-linebreak': ['error', 'after'],
|
|
317
|
+
'@stylistic/padded-blocks': ['error', 'never'],
|
|
318
|
+
'@stylistic/padding-line-between-statements': 'error',
|
|
319
|
+
'@stylistic/quote-props': ['error', 'consistent-as-needed'],
|
|
320
|
+
'@stylistic/quotes': ['error', 'single', {avoidEscape: true}],
|
|
321
|
+
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
322
|
+
'@stylistic/semi': ['error', 'always'],
|
|
323
|
+
'@stylistic/semi-spacing': 'error',
|
|
324
|
+
'@stylistic/semi-style': ['error'],
|
|
325
|
+
'@stylistic/space-before-blocks': 'error',
|
|
326
|
+
'@stylistic/space-before-function-paren': ['error', 'never'],
|
|
327
|
+
'@stylistic/space-in-parens': 'error',
|
|
328
|
+
'@stylistic/space-infix-ops': ['error', {int32Hint: false}],
|
|
329
|
+
'@stylistic/space-unary-ops': 'error',
|
|
330
|
+
'@stylistic/spaced-comment': ['error', 'always'],
|
|
331
|
+
'@stylistic/switch-colon-spacing': 'error',
|
|
332
|
+
'@stylistic/template-curly-spacing': 'error',
|
|
333
|
+
'@stylistic/template-tag-spacing': 'error',
|
|
334
|
+
'@stylistic/type-annotation-spacing': 'off', // Not TS.
|
|
335
|
+
'@stylistic/type-generic-spacing': 'off', // Not TS.
|
|
336
|
+
'@stylistic/type-named-tuple-spacing': 'off', // Not TS.
|
|
337
|
+
'@stylistic/wrap-iife': 'error',
|
|
338
|
+
'@stylistic/wrap-regex': 'off', // No.
|
|
339
|
+
'@stylistic/yield-star-spacing': ['error', 'before'],
|
|
273
340
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
ignoreUrls: true,
|
|
295
|
-
}],
|
|
296
|
-
'@stylistic/max-statements-per-line': 'off',
|
|
297
|
-
'@stylistic/member-delimiter-style': 'off',
|
|
298
|
-
'@stylistic/multiline-comment-style': 'off', // Not important
|
|
299
|
-
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
300
|
-
'@stylistic/new-parens': 'error',
|
|
301
|
-
'@stylistic/newline-per-chained-call': 'error',
|
|
302
|
-
'@stylistic/no-confusing-arrow': 'error',
|
|
303
|
-
'@stylistic/no-extra-parens': 'off', // Too fiddly to torn off everything.
|
|
304
|
-
'@stylistic/no-extra-semi': 'error',
|
|
305
|
-
'@stylistic/no-floating-decimal': 'error',
|
|
306
|
-
'@stylistic/no-mixed-operators': 'error',
|
|
307
|
-
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
308
|
-
'@stylistic/no-multi-spaces': 'error',
|
|
309
|
-
'@stylistic/no-multiple-empty-lines': ['error', {max: 1}],
|
|
310
|
-
'@stylistic/no-tabs': 'error',
|
|
311
|
-
'@stylistic/no-trailing-spaces': 'error',
|
|
312
|
-
'@stylistic/no-whitespace-before-property': 'error',
|
|
313
|
-
'@stylistic/nonblock-statement-body-position': 'error',
|
|
314
|
-
'@stylistic/object-curly-newline': 'error',
|
|
315
|
-
'@stylistic/object-curly-spacing': ['error', 'never'],
|
|
316
|
-
'@stylistic/object-property-newline': ['error', {allowAllPropertiesOnSameLine: true}],
|
|
317
|
-
'@stylistic/one-var-declaration-per-line': 'error',
|
|
318
|
-
'@stylistic/operator-linebreak': ['error', 'after'],
|
|
319
|
-
'@stylistic/padded-blocks': ['error', 'never'],
|
|
320
|
-
'@stylistic/padding-line-between-statements': 'error',
|
|
321
|
-
'@stylistic/quote-props': ['error', 'consistent-as-needed'],
|
|
322
|
-
'@stylistic/quotes': ['error', 'single', {avoidEscape: true}],
|
|
323
|
-
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
324
|
-
'@stylistic/semi': ['error', 'always'],
|
|
325
|
-
'@stylistic/semi-spacing': 'error',
|
|
326
|
-
'@stylistic/semi-style': ['error'],
|
|
327
|
-
'@stylistic/space-before-blocks': 'error',
|
|
328
|
-
'@stylistic/space-before-function-paren': ['error', 'never'],
|
|
329
|
-
'@stylistic/space-in-parens': 'error',
|
|
330
|
-
'@stylistic/space-infix-ops': ['error', {int32Hint: false}],
|
|
331
|
-
'@stylistic/space-unary-ops': 'error',
|
|
332
|
-
'@stylistic/spaced-comment': ['error', 'always'],
|
|
333
|
-
'@stylistic/switch-colon-spacing': 'error',
|
|
334
|
-
'@stylistic/template-curly-spacing': 'error',
|
|
335
|
-
'@stylistic/template-tag-spacing': 'error',
|
|
336
|
-
'@stylistic/type-annotation-spacing': 'off', // Not TS.
|
|
337
|
-
'@stylistic/type-generic-spacing': 'off', // Not TS.
|
|
338
|
-
'@stylistic/type-named-tuple-spacing': 'off', // Not TS.
|
|
339
|
-
'@stylistic/wrap-iife': 'error',
|
|
340
|
-
'@stylistic/wrap-regex': 'off', // No.
|
|
341
|
-
'@stylistic/yield-star-spacing': ['error', 'before'],
|
|
341
|
+
// [Possible Errors](https://github.com/eslint-community/eslint-plugin-n#possible-errors)
|
|
342
|
+
'n/handle-callback-err': ['error', 'er'],
|
|
343
|
+
'n/no-callback-literal': 'error',
|
|
344
|
+
'n/no-exports-assign': 'error',
|
|
345
|
+
'n/no-extraneous-import': 'error',
|
|
346
|
+
'n/no-extraneous-require': 'error',
|
|
347
|
+
'n/no-missing-import': ['error', {
|
|
348
|
+
allowModules: ['ava'], // Ava uses fancy new stuff, so shows up unavailable.
|
|
349
|
+
}],
|
|
350
|
+
'n/no-missing-require': 'off', // This one doesn't work yet:
|
|
351
|
+
'n/no-new-require': 'error',
|
|
352
|
+
'n/no-path-concat': 'error',
|
|
353
|
+
'n/no-process-exit': 'off', // No.
|
|
354
|
+
'n/no-unpublished-bin': 'error',
|
|
355
|
+
'n/no-unpublished-import': 'off', // Doesn't work
|
|
356
|
+
'n/no-unpublished-require': 'off', // Doesn't work
|
|
357
|
+
'n/no-unsupported-features/es-builtins': 'error',
|
|
358
|
+
'n/no-unsupported-features/es-syntax': 'error',
|
|
359
|
+
'n/no-unsupported-features/node-builtins': 'error',
|
|
360
|
+
'n/process-exit-as-throw': 'error',
|
|
342
361
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
'n/no-callback-literal': 'error',
|
|
346
|
-
'n/no-exports-assign': 'error',
|
|
347
|
-
'n/no-extraneous-import': 'error',
|
|
348
|
-
'n/no-extraneous-require': 'error',
|
|
349
|
-
'n/no-missing-import': ['error', {
|
|
350
|
-
allowModules: ['ava'], // Ava uses fancy new stuff, so shows up unavailable.
|
|
351
|
-
}],
|
|
352
|
-
'n/no-missing-require': 'off', // This one doesn't work yet:
|
|
353
|
-
'n/no-new-require': 'error',
|
|
354
|
-
'n/no-path-concat': 'error',
|
|
355
|
-
'n/no-process-exit': 'off', // No.
|
|
356
|
-
'n/no-unpublished-bin': 'error',
|
|
357
|
-
'n/no-unpublished-import': 'off', // Doesn't work
|
|
358
|
-
'n/no-unpublished-require': 'off', // Doesn't work
|
|
359
|
-
'n/no-unsupported-features/es-builtins': 'error',
|
|
360
|
-
'n/no-unsupported-features/es-syntax': 'error',
|
|
361
|
-
'n/no-unsupported-features/node-builtins': 'error',
|
|
362
|
-
'n/process-exit-as-throw': 'error',
|
|
362
|
+
// [Best Practices](https://github.com/eslint-community/eslint-plugin-n#best-practices)
|
|
363
|
+
'n/no-deprecated-api': 'error',
|
|
363
364
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
// Not yet
|
|
388
|
-
'n/prefer-promises/dns': 'off',
|
|
389
|
-
'n/prefer-promises/fs': 'off',
|
|
390
|
-
},
|
|
365
|
+
// [Stylistic Issues](https://github.com/eslint-community/eslint-plugin-n#stylistic-issues)
|
|
366
|
+
'n/callback-return': 'off', // No
|
|
367
|
+
'n/exports-style': 'off',
|
|
368
|
+
// Doesn't work for `import 'regenerator-runtime/runtime'`
|
|
369
|
+
'n/file-extension-in-import': 'error',
|
|
370
|
+
'n/global-require': 'off',
|
|
371
|
+
'n/hashbang': 'off', // Try turning this on sometime
|
|
372
|
+
'n/no-mixed-requires': 'error',
|
|
373
|
+
'n/no-process-env': 'off', // No
|
|
374
|
+
'n/no-restricted-import': 'off',
|
|
375
|
+
'n/no-restricted-require': 'off',
|
|
376
|
+
'n/no-sync': 'off',
|
|
377
|
+
'n/prefer-global/buffer': ['error', 'never'],
|
|
378
|
+
'n/prefer-global/console': 'off', // Hopefully only used in tests and cli
|
|
379
|
+
'n/prefer-global/process': 'off',
|
|
380
|
+
'n/prefer-global/text-decoder': ['error', 'always'],
|
|
381
|
+
'n/prefer-global/text-encoder': ['error', 'always'],
|
|
382
|
+
'n/prefer-global/url': ['error', 'always'],
|
|
383
|
+
'n/prefer-global/url-search-params': ['error', 'always'],
|
|
384
|
+
'n/prefer-node-protocol': 'error', // Turn off when needed
|
|
385
|
+
// Not yet
|
|
386
|
+
'n/prefer-promises/dns': 'off',
|
|
387
|
+
'n/prefer-promises/fs': 'off',
|
|
391
388
|
};
|