@whitetrefoil/eslint-config 0.29.1 → 0.30.1

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/README.md CHANGED
@@ -86,6 +86,10 @@ See Also
86
86
  Changelog
87
87
  ---------
88
88
 
89
+ ## v0.30.0
90
+
91
+ * update rules;
92
+
89
93
  ## v0.29.0
90
94
 
91
95
  * remove dependencies check totally;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitetrefoil/eslint-config",
3
- "version": "0.29.1",
3
+ "version": "0.30.1",
4
4
  "author": "WhiteTrefoil <whitetrefoil@gmail.com>",
5
5
  "license": "Unlicense",
6
6
  "engines": {
@@ -11,24 +11,24 @@
11
11
  "rules"
12
12
  ],
13
13
  "dependencies": {
14
- "eslint": "^8.24.0"
14
+ "eslint": "^8.26.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@typescript-eslint/eslint-plugin": "^5.38.1",
18
- "@typescript-eslint/parser": "^5.38.1",
17
+ "@typescript-eslint/eslint-plugin": "^5.40.1",
18
+ "@typescript-eslint/parser": "^5.40.1",
19
19
  "eslint-plugin-node": "^11.1.0",
20
- "eslint-plugin-react": "^7.31.8",
20
+ "eslint-plugin-react": "^7.31.10",
21
21
  "eslint-plugin-react-hooks": "^4.6.0",
22
- "eslint-plugin-vue": "^9.5.1",
22
+ "eslint-plugin-vue": "^9.6.0",
23
23
  "typescript": "^4.8.4"
24
24
  },
25
25
  "peerDependencies": {
26
- "@typescript-eslint/eslint-plugin": "^5.38.1",
27
- "@typescript-eslint/parser": "^5.38.1",
26
+ "@typescript-eslint/eslint-plugin": "^5.40.1",
27
+ "@typescript-eslint/parser": "^5.40.1",
28
28
  "eslint-plugin-node": "^11.1.0",
29
- "eslint-plugin-react": "^7.31.8",
29
+ "eslint-plugin-react": "^7.31.10",
30
30
  "eslint-plugin-react-hooks": "^4.6.0",
31
- "eslint-plugin-vue": "^9.5.1",
31
+ "eslint-plugin-vue": "^9.6.0",
32
32
  "typescript": "^4.8.4"
33
33
  },
34
34
  "peerDependenciesMeta": {
@@ -54,5 +54,5 @@
54
54
  "optional": true
55
55
  }
56
56
  },
57
- "packageManager": "yarn@3.2.0"
57
+ "packageManager": "yarn@3.2.4"
58
58
  }
package/rules/base.js CHANGED
@@ -19,7 +19,7 @@ module.exports = {
19
19
  'no-compare-neg-zero' : [2],
20
20
  'no-cond-assign' : [2],
21
21
  'no-const-assign' : [2],
22
- 'no-constant-condition' : [2, { 'checkLoops': false }],
22
+ 'no-constant-condition' : [2, {'checkLoops': false}],
23
23
  'no-constructor-return' : [2],
24
24
  'no-control-regex' : [2],
25
25
  'no-debugger' : [2],
@@ -59,7 +59,7 @@ module.exports = {
59
59
  'no-unsafe-negation' : [2],
60
60
  'no-unsafe-optional-chaining' : [2],
61
61
  'no-unused-private-class-members': [1],
62
- 'no-unused-vars' : [2, { vars: 'all', args: 'none' }],
62
+ 'no-unused-vars' : [2, {vars: 'all', args: 'none'}],
63
63
  'no-use-before-define' : [2],
64
64
  'no-useless-backreference' : [2],
65
65
  // Waiting for a better rule: https://github.com/eslint/eslint/issues/11899
@@ -72,7 +72,7 @@ module.exports = {
72
72
  'accessor-pairs' : [1],
73
73
  'arrow-body-style' : [2, 'as-needed'],
74
74
  'block-scoped-var' : [0],
75
- 'camelcase' : [2, { properties: 'always' }],
75
+ 'camelcase' : [2, {properties: 'always'}],
76
76
  'capitalized-comments' : [0],
77
77
  'class-methods-use-this': [0],
78
78
  'complexity' : [0],
@@ -84,8 +84,8 @@ module.exports = {
84
84
  'default-case-last' : [2],
85
85
  'default-param-last': [2],
86
86
  // Considering the consistency when acquiring object from API.
87
- 'dot-notation' : [1, { allowKeywords: true, allowPattern: '[_-]' }],
88
- 'eqeqeq' : [2, 'always', { null: 'ignore' }],
87
+ 'dot-notation' : [1, {allowKeywords: true, allowPattern: '[_-]'}],
88
+ 'eqeqeq' : [2, 'always', {null: 'ignore'}],
89
89
  'func-name-matching': [1, 'always'],
90
90
  // Not this time.
91
91
  'func-names' : [0],
@@ -105,13 +105,13 @@ module.exports = {
105
105
  'max-params' : [0],
106
106
  'max-statements' : [0],
107
107
  'multiline-comment-style' : [0],
108
- 'new-cap' : [0, { capIsNew: true, newIsCap: true }],
108
+ 'new-cap' : [0, {capIsNew: true, newIsCap: true}],
109
109
  'no-alert' : [2],
110
110
  'no-array-constructor' : [2],
111
111
  'no-bitwise' : [1],
112
112
  'no-caller' : [2],
113
113
  'no-case-declarations' : [2],
114
- 'no-confusing-arrow' : [0, { onlyOneSimpleParam: true }],
114
+ 'no-confusing-arrow' : [0, {onlyOneSimpleParam: true}],
115
115
  'no-console' : [2],
116
116
  'no-continue' : [0],
117
117
  'no-delete-var' : [2],
@@ -166,7 +166,7 @@ module.exports = {
166
166
  'no-nonoctal-decimal-escape' : [1],
167
167
  'no-octal' : [2],
168
168
  'no-octal-escape' : [2],
169
- 'no-param-reassign' : [1, { props: false }],
169
+ 'no-param-reassign' : [1, {props: false}],
170
170
  'no-plusplus' : [0],
171
171
  'no-proto' : [2],
172
172
  'no-redeclare' : [2],
@@ -180,7 +180,7 @@ module.exports = {
180
180
  'no-return-await' : [2],
181
181
  'no-script-url' : [1],
182
182
  'no-sequences' : [2],
183
- 'no-shadow' : [1, { ignoreOnInitialization: true }],
183
+ 'no-shadow' : [1, {ignoreOnInitialization: true}],
184
184
  'no-shadow-restricted-names' : [2],
185
185
  'no-ternary' : [0],
186
186
  'no-throw-literal' : [1],
@@ -206,7 +206,7 @@ module.exports = {
206
206
  'no-useless-return' : [1],
207
207
  'no-var' : [2],
208
208
  'no-void' : [0],
209
- 'no-warning-comments' : [1, { location: 'anywhere' }],
209
+ 'no-warning-comments' : [1, {location: 'anywhere'}],
210
210
  'no-with' : [2],
211
211
  'object-shorthand' : [2, 'always'],
212
212
  'one-var' : [2, 'never'],
@@ -231,7 +231,7 @@ module.exports = {
231
231
  'prefer-numeric-literals' : [2],
232
232
  'prefer-object-has-own' : [1],
233
233
  'prefer-object-spread' : [1],
234
- 'prefer-promise-reject-errors' : [2, { allowEmptyReject: true }],
234
+ 'prefer-promise-reject-errors' : [2, {allowEmptyReject: true}],
235
235
  'prefer-regex-literals' : [2],
236
236
  'prefer-rest-params' : [1],
237
237
  'prefer-spread' : [2],
@@ -248,7 +248,7 @@ module.exports = {
248
248
  'strict' : [2, 'global'],
249
249
  'symbol-description' : [2],
250
250
  'vars-on-top' : [0],
251
- 'yoda' : [2, 'never', { exceptRange: true }],
251
+ 'yoda' : [2, 'never', {exceptRange: true}],
252
252
 
253
253
  // Layout & Formatting
254
254
  // -------------------
@@ -259,7 +259,7 @@ module.exports = {
259
259
  'arrow-parens' : [2, 'as-needed'],
260
260
  'arrow-spacing' : [2],
261
261
  'block-spacing' : [2],
262
- 'brace-style' : [2, '1tbs', { allowSingleLine: true }],
262
+ 'brace-style' : [2, '1tbs', {allowSingleLine: true}],
263
263
  'comma-dangle' : [2, 'always-multiline'],
264
264
  'comma-spacing' : [2],
265
265
  // No need for comma-first style due to allow of extra tailing comma.
@@ -274,17 +274,17 @@ module.exports = {
274
274
  'generator-star-spacing' : [2, 'before'],
275
275
  'implicit-arrow-linebreak' : [0],
276
276
  // Leave this to IDEA
277
- 'indent' : [0, 2, { SwitchCase: 1, ignoreComments: true }],
277
+ 'indent' : [0, 2, {SwitchCase: 1, ignoreComments: true}],
278
278
  'jsx-quotes' : [0],
279
279
  'key-spacing' : [0],
280
- 'keyword-spacing' : [2, { before: true, after: true, overrides: {} }],
280
+ 'keyword-spacing' : [2, {before: true, after: true, overrides: {}}],
281
281
  'line-comment-position': [0],
282
282
  // Leave this to Git.
283
283
  'linebreak-style' : [0],
284
284
  'lines-around-comment' : [0],
285
285
  'lines-between-class-members': [0],
286
286
  'max-len' : [0],
287
- 'max-statements-per-line' : [1, { max: 1 }],
287
+ 'max-statements-per-line' : [1, {max: 1}],
288
288
  'multiline-ternary' : [0],
289
289
  'new-parens' : [2],
290
290
  'newline-per-chained-call' : [0],
@@ -302,28 +302,30 @@ module.exports = {
302
302
  'no-multi-spaces' : [0],
303
303
  // Use more than 3 empty lines to mark debug codes.
304
304
  // eslint-disable-next-line no-magic-numbers
305
- 'no-multiple-empty-lines' : [2, { max: 3, maxEOF: 1 }],
305
+ 'no-multiple-empty-lines' : [2, {max: 3, maxEOF: 1}],
306
306
  'no-tabs' : [2],
307
307
  'no-trailing-spaces' : [2],
308
308
  'no-whitespace-before-property' : [2],
309
309
  'nonblock-statement-body-position': [0],
310
- 'object-curly-newline' : [2, { consistent: true }],
311
- 'object-curly-spacing' : [2, 'always'],
312
- 'object-property-newline' : [0],
310
+ 'object-curly-newline' : [2, {consistent: true}],
311
+ // [LATER] wait for a while
312
+ // 'object-curly-spacing': [2, 'never'],
313
+ 'object-curly-spacing' : [0, 'never'],
314
+ 'object-property-newline': [0],
313
315
  // Not this time.
314
316
  'operator-linebreak' : [0],
315
317
  'padded-blocks' : [0],
316
318
  'padding-line-between-statements': [0],
317
- 'quotes' : [2, 'single', { avoidEscape: true }],
319
+ 'quotes' : [2, 'single', {avoidEscape: true}],
318
320
  'rest-spread-spacing' : [2],
319
321
  'semi' : [2, 'never'],
320
- 'semi-spacing' : [2, { before: false, after: true }],
322
+ 'semi-spacing' : [2, {before: false, after: true}],
321
323
  'semi-style' : [0, 'last'],
322
324
  'space-before-blocks' : [2, 'always'],
323
325
  'space-before-function-paren' : [2, 'never'],
324
326
  'space-in-parens' : [2, 'never'],
325
- 'space-infix-ops' : [2, { int32Hint: true }],
326
- 'space-unary-ops' : [2, { words: true, nonwords: false }],
327
+ 'space-infix-ops' : [2, {int32Hint: true}],
328
+ 'space-unary-ops' : [2, {words: true, nonwords: false}],
327
329
  'switch-colon-spacing' : [1],
328
330
  'template-curly-spacing' : [1],
329
331
  'template-tag-spacing' : [2],
package/rules/node.js CHANGED
@@ -12,7 +12,7 @@ module.exports = {
12
12
  // eslint-plugin-node
13
13
  // ------------------
14
14
  'node/handle-callback-err' : [1],
15
- 'node/no-callback-literal' : [2],
15
+ 'node/no-callback-literal' : [0],
16
16
  'node/no-exports-assign' : [2],
17
17
  'node/no-extraneous-import' : [0],
18
18
  'node/no-extraneous-require' : [0],
@@ -20,7 +20,7 @@ module.exports = {
20
20
  'node/no-missing-require' : [0],
21
21
  'node/no-new-require' : [2],
22
22
  'node/no-path-concat' : [2],
23
- 'node/no-process-exit' : [2],
23
+ 'node/no-process-exit' : [0],
24
24
  'node/no-unpublished-bin' : [0],
25
25
  'node/no-unpublished-import' : [0],
26
26
  'node/no-unpublished-require' : [0],
@@ -35,21 +35,21 @@ module.exports = {
35
35
  'node/callback-return' : [0],
36
36
  'node/exports-style' : [2],
37
37
  'node/file-extension-in-import' : [0],
38
- 'node/global-require' : [1],
38
+ 'node/global-require' : [0],
39
39
  'node/no-mixed-requires' : [2],
40
40
  'node/no-process-env' : [0],
41
41
  'node/no-restricted-import' : [0],
42
42
  'node/no-restricted-require' : [0],
43
43
  'node/no-sync' : [0],
44
- 'node/prefer-global/buffer' : [2],
45
- 'node/prefer-global/console' : [2],
46
- 'node/prefer-global/process' : [2],
47
- 'node/prefer-global/text-decoder' : [2],
48
- 'node/prefer-global/text-encoder' : [2],
44
+ 'node/prefer-global/buffer' : [0],
45
+ 'node/prefer-global/console' : [0],
46
+ 'node/prefer-global/process' : [0],
47
+ 'node/prefer-global/text-decoder' : [0],
48
+ 'node/prefer-global/text-encoder' : [0],
49
49
  // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960
50
50
  'node/prefer-global/url-search-params': [0],
51
51
  'node/prefer-global/url' : [0],
52
- 'node/prefer-promises/dns' : [2],
53
- 'node/prefer-promises/fs' : [2],
52
+ 'node/prefer-promises/dns' : [0],
53
+ 'node/prefer-promises/fs' : [0],
54
54
  },
55
55
  }
package/rules/react.js CHANGED
@@ -1,4 +1,4 @@
1
- // Rules up to v7.28.0
1
+ // Rules up to v7.31
2
2
  // @see https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md
3
3
 
4
4
  module.exports = {
package/rules/ts-types.js CHANGED
@@ -1,4 +1,4 @@
1
- // Rules up to v5.24.0
1
+ // Rules up to v5.40
2
2
  // @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md
3
3
 
4
4
  // These are rules need type info which will be much slower
@@ -50,7 +50,7 @@ module.exports = {
50
50
  '@typescript-eslint/prefer-string-starts-ends-with' : [1],
51
51
  '@typescript-eslint/promise-function-async' : [2],
52
52
  '@typescript-eslint/require-array-sort-compare' : [2],
53
- '@typescript-eslint/restrict-plus-operands' : [1, { 'checkCompoundAssignments': true }],
53
+ '@typescript-eslint/restrict-plus-operands' : [1, {'checkCompoundAssignments': true}],
54
54
  '@typescript-eslint/restrict-template-expressions' : [1],
55
55
  '@typescript-eslint/strict-boolean-expressions' : [
56
56
  2, {
@@ -66,7 +66,10 @@ module.exports = {
66
66
  '@typescript-eslint/switch-exhaustiveness-check' : [2],
67
67
  '@typescript-eslint/unbound-method' : [2],
68
68
  'dot-notation' : [0],
69
- '@typescript-eslint/dot-notation' : [1, { allowKeywords: true, allowPattern: '[_-]' }],
69
+ '@typescript-eslint/dot-notation' : [1, {
70
+ allowKeywords: true,
71
+ allowPattern : '[_-]',
72
+ }],
70
73
  'require-await' : [0],
71
74
  '@typescript-eslint/require-await' : [2],
72
75
  'return-await' : [0],
package/rules/ts.js CHANGED
@@ -1,4 +1,4 @@
1
- // Rules up to v5.24.0
1
+ // Rules up to v5.40
2
2
  // @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md
3
3
 
4
4
  // These are rules don't need type info
@@ -13,7 +13,7 @@ module.exports = {
13
13
 
14
14
  rules: {
15
15
  '@typescript-eslint/adjacent-overload-signatures' : [1],
16
- '@typescript-eslint/array-type' : [1, { default: 'array-simple' }],
16
+ '@typescript-eslint/array-type' : [1, {default: 'array-simple'}],
17
17
  '@typescript-eslint/ban-ts-comment' : [1],
18
18
  '@typescript-eslint/ban-tslint-comment' : [1],
19
19
  '@typescript-eslint/ban-types' : [
@@ -26,6 +26,7 @@ module.exports = {
26
26
  },
27
27
  ],
28
28
  '@typescript-eslint/class-literal-property-style' : [0],
29
+ '@typescript-eslint/consistent-generic-constructors': [0],
29
30
  '@typescript-eslint/consistent-indexed-object-style': [0],
30
31
  '@typescript-eslint/consistent-type-assertions' : [
31
32
  1,
@@ -63,8 +64,8 @@ module.exports = {
63
64
  '@typescript-eslint/member-delimiter-style' : [
64
65
  2,
65
66
  {
66
- multiline : { delimiter: 'none', requireLast: true },
67
- singleline: { delimiter: 'comma', requireLast: false },
67
+ multiline : {delimiter: 'none', requireLast: true},
68
+ singleline: {delimiter: 'comma', requireLast: false},
68
69
  },
69
70
  ],
70
71
  '@typescript-eslint/member-ordering' : [0],
@@ -145,14 +146,14 @@ module.exports = {
145
146
  '@typescript-eslint/prefer-enum-initializers' : [0],
146
147
  '@typescript-eslint/prefer-for-of' : [1],
147
148
  '@typescript-eslint/prefer-function-type' : [1],
148
- '@typescript-eslint/prefer-literal-enum-member' : [1, { allowBitwiseExpressions: true }],
149
+ '@typescript-eslint/prefer-literal-enum-member' : [1, {allowBitwiseExpressions: true}],
149
150
  '@typescript-eslint/prefer-namespace-keyword' : [1],
150
151
  '@typescript-eslint/prefer-optional-chain' : [2],
151
152
  '@typescript-eslint/prefer-ts-expect-error' : [1],
152
153
  '@typescript-eslint/sort-type-union-intersection-members': [0],
153
154
  '@typescript-eslint/triple-slash-reference' : [
154
155
  1,
155
- { path: 'never', types: 'prefer-import', lib: 'never' },
156
+ {path: 'never', types: 'prefer-import', lib: 'never'},
156
157
  ],
157
158
  '@typescript-eslint/type-annotation-spacing' : [2],
158
159
  // @see Note in https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/typedef.md
@@ -162,7 +163,7 @@ module.exports = {
162
163
  // Overrides ESLint rules
163
164
  // ----------------------
164
165
  'brace-style' : [0],
165
- '@typescript-eslint/brace-style' : [2, '1tbs', { allowSingleLine: true }],
166
+ '@typescript-eslint/brace-style' : [2, '1tbs', {allowSingleLine: true}],
166
167
  'comma-dangle' : [0],
167
168
  '@typescript-eslint/comma-dangle' : [2, 'always-multiline'],
168
169
  'comma-spacing' : [0],
@@ -176,12 +177,16 @@ module.exports = {
176
177
  '@typescript-eslint/indent' : [
177
178
  0,
178
179
  2,
179
- { SwitchCase: 1, ignoreComments: true },
180
+ {SwitchCase: 1, ignoreComments: true},
180
181
  ],
181
182
  'init-declarations' : [0],
182
183
  '@typescript-eslint/init-declarations' : [0],
183
184
  'keyword-spacing' : [0],
184
- '@typescript-eslint/keyword-spacing' : [2, { before: true, after: true, overrides: {} }],
185
+ '@typescript-eslint/keyword-spacing' : [2, {
186
+ before : true,
187
+ after : true,
188
+ overrides: {},
189
+ }],
185
190
  'lines-between-class-members' : [0],
186
191
  '@typescript-eslint/lines-between-class-members': [0],
187
192
  'no-array-constructor' : [0],
@@ -234,21 +239,25 @@ module.exports = {
234
239
  },
235
240
  ],
236
241
  'no-unused-vars' : [0],
237
- '@typescript-eslint/no-unused-vars' : [2, { vars: 'all', args: 'none' }],
242
+ '@typescript-eslint/no-unused-vars' : [2, {
243
+ vars: 'all',
244
+ args: 'none',
245
+ }],
238
246
  'no-use-before-define' : [0],
239
247
  '@typescript-eslint/no-use-before-define' : [0],
240
248
  'no-useless-constructor' : [0],
241
249
  '@typescript-eslint/no-useless-constructor' : [0],
242
250
  'object-curly-spacing' : [0],
243
- '@typescript-eslint/object-curly-spacing' : [2, 'always'],
251
+ // '@typescript-eslint/object-curly-spacing' : [2, 'always'],
252
+ '@typescript-eslint/object-curly-spacing' : [0, 'never'],
244
253
  'quotes' : [0],
245
- '@typescript-eslint/quotes' : [2, 'single', { avoidEscape: true }],
254
+ '@typescript-eslint/quotes' : [2, 'single', {avoidEscape: true}],
246
255
  'semi' : [0],
247
256
  '@typescript-eslint/semi' : [2, 'never'],
248
257
  'space-before-function-paren' : [0],
249
258
  '@typescript-eslint/space-before-function-paren': [0],
250
259
  'space-infix-ops' : [0],
251
- '@typescript-eslint/space-infix-ops' : [0, { int32Hint: true }],
260
+ '@typescript-eslint/space-infix-ops' : [0, {int32Hint: true}],
252
261
 
253
262
  // Disable this rule due to TS hasn't supported it yet
254
263
  'prefer-object-has-own': [0],
package/rules/vue2.js CHANGED
@@ -1,4 +1,4 @@
1
- // Rules up to v7.4.1
1
+ // Just follow the recommends
2
2
  // @see https://eslint.vuejs.org/user-guide/
3
3
 
4
4
  module.exports = {
package/rules/vue3.js CHANGED
@@ -1,4 +1,4 @@
1
- // Rules up to v7.4.1
1
+ // Just follow the recommends
2
2
  // @see https://eslint.vuejs.org/user-guide/
3
3
 
4
4
  module.exports = {