@whitetrefoil/eslint-config 0.36.5 → 0.37.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/base.js CHANGED
@@ -18,6 +18,9 @@ module.exports = {
18
18
  es2017: true,
19
19
  es2020: true,
20
20
  es2021: true,
21
+ es2022: true,
22
+ es2023: true,
23
+ es2024: true,
21
24
  },
22
25
 
23
26
  extends: [
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@whitetrefoil/eslint-config",
3
- "version": "0.36.5",
3
+ "version": "0.37.0",
4
4
  "author": "WhiteTrefoil <whitetrefoil@gmail.com>",
5
5
  "license": "Unlicense",
6
6
  "engines": {
7
- "node": ">=12.18.0"
7
+ "node": ">=18.12.0"
8
8
  },
9
9
  "files": [
10
10
  "*.js",
@@ -14,22 +14,23 @@
14
14
  "eslint-plugin-eslint-comments": "^3.2.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@typescript-eslint/eslint-plugin": "^6.0.0",
18
- "@typescript-eslint/parser": "^6.0.0",
19
- "eslint": "^8.44.0",
17
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
18
+ "@typescript-eslint/parser": "^6.19.0",
19
+ "eslint": "^8.56.0",
20
20
  "eslint-plugin-node": "^11.1.0",
21
21
  "eslint-plugin-react": "^7.32.2",
22
22
  "eslint-plugin-react-hooks": "^4.6.0",
23
- "eslint-plugin-vue": "^9.15.1",
24
- "typescript": "^5.1.6"
23
+ "eslint-plugin-vue": "^9.20.1",
24
+ "typescript": "^5.3.3"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@typescript-eslint/eslint-plugin": "^6.0.0",
28
28
  "@typescript-eslint/parser": "^6.0.0",
29
29
  "eslint": "^8.44.0",
30
30
  "eslint-plugin-node": "^11.1.0",
31
- "eslint-plugin-react": "^7.32.2",
31
+ "eslint-plugin-react": "^7.33.2",
32
32
  "eslint-plugin-react-hooks": "^4.6.0",
33
+ "eslint-plugin-solid": "~0.13.1",
33
34
  "eslint-plugin-vue": "^9.15.1",
34
35
  "typescript": ">=5.1.0"
35
36
  },
@@ -49,6 +50,9 @@
49
50
  "eslint-plugin-react-hooks": {
50
51
  "optional": true
51
52
  },
53
+ "eslint-plugin-solid": {
54
+ "optional": true
55
+ },
52
56
  "eslint-plugin-vue": {
53
57
  "optional": true
54
58
  },
@@ -56,5 +60,5 @@
56
60
  "optional": true
57
61
  }
58
62
  },
59
- "packageManager": "yarn@3.5.1"
63
+ "packageManager": "yarn@4.0.2"
60
64
  }
package/rules/base.js CHANGED
@@ -1,4 +1,4 @@
1
- // Rules up to v8.10.0
1
+ // Rules up to v8.56.0
2
2
  // @see https://github.com/eslint/eslint/releases
3
3
 
4
4
  module.exports = {
@@ -19,6 +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-binary-expression' : [1],
22
23
  'no-constant-condition' : [2, {'checkLoops': false}],
23
24
  'no-constructor-return' : [2],
24
25
  'no-control-regex' : [2],
@@ -40,6 +41,7 @@ module.exports = {
40
41
  'no-irregular-whitespace' : [2],
41
42
  'no-loss-of-precision' : [2],
42
43
  'no-misleading-character-class' : [2],
44
+ 'no-new-native-nonconstructor' : [2],
43
45
  'no-new-symbol' : [2],
44
46
  'no-obj-calls' : [2],
45
47
  'no-promise-executor-return' : [2],
@@ -60,7 +62,7 @@ module.exports = {
60
62
  'no-unsafe-optional-chaining' : [2],
61
63
  'no-unused-private-class-members': [1],
62
64
  'no-unused-vars' : [2, {vars: 'all', args: 'none'}],
63
- 'no-use-before-define' : [2],
65
+ 'no-use-before-define' : [2, {allowNamedExports: true}],
64
66
  'no-useless-backreference' : [2],
65
67
  // Waiting for a better rule: https://github.com/eslint/eslint/issues/11899
66
68
  'require-atomic-updates': [0],
@@ -97,6 +99,7 @@ module.exports = {
97
99
  'id-length' : [0],
98
100
  'id-match' : [0],
99
101
  'init-declarations' : [0],
102
+ 'logical-assignment-operators' : [0],
100
103
  'max-classes-per-file' : [0],
101
104
  'max-depth' : [0],
102
105
  'max-lines' : [0],
@@ -119,6 +122,7 @@ module.exports = {
119
122
  'no-else-return' : [1],
120
123
  'no-empty' : [2],
121
124
  'no-empty-function' : [2],
125
+ 'no-empty-static-block' : [1],
122
126
  'no-eq-null' : [0],
123
127
  'no-eval' : [2],
124
128
  'no-extend-native' : [2],
@@ -161,9 +165,9 @@ module.exports = {
161
165
  'no-nested-ternary' : [0],
162
166
  'no-new' : [1],
163
167
  'no-new-func' : [2],
164
- 'no-new-object' : [2],
165
168
  'no-new-wrappers' : [2],
166
169
  'no-nonoctal-decimal-escape' : [1],
170
+ 'no-object-constructor' : [2],
167
171
  'no-octal' : [2],
168
172
  'no-octal-escape' : [2],
169
173
  'no-param-reassign' : [1, {props: false}],
@@ -214,18 +218,7 @@ module.exports = {
214
218
  'operator-assignment' : [0],
215
219
  'prefer-arrow-callback' : [0],
216
220
  'prefer-const' : [2],
217
- 'prefer-destructuring' : [
218
- 1, {
219
- VariableDeclarator : {
220
- array : false,
221
- object: true,
222
- },
223
- AssignmentExpression: {
224
- array : false,
225
- object: false,
226
- },
227
- },
228
- ],
221
+ 'prefer-destructuring' : [0],
229
222
  'prefer-exponentiation-operator': [1],
230
223
  'prefer-named-capture-group' : [0],
231
224
  'prefer-numeric-literals' : [2],
package/rules/solid.js ADDED
@@ -0,0 +1,7 @@
1
+ // Just follow the recommends
2
+ // @see https://github.com/solidjs-community/eslint-plugin-solid
3
+
4
+ module.exports = {
5
+ plugins: ['solid'],
6
+ extends: ['plugin:solid/typescript'],
7
+ }
package/rules/ts-types.js CHANGED
@@ -1,4 +1,4 @@
1
- // Rules up to v6.0
1
+ // Rules up to v6.19
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
@@ -41,6 +41,8 @@ module.exports = {
41
41
  '@typescript-eslint/no-unsafe-enum-comparison' : [2],
42
42
  '@typescript-eslint/no-unsafe-member-access' : [2],
43
43
  '@typescript-eslint/no-unsafe-return' : [2],
44
+ '@typescript-eslint/no-unsafe-unary-minus' : [2],
45
+ '@typescript-eslint/no-useless-template-literals' : [2],
44
46
  '@typescript-eslint/non-nullable-type-assertion-style' : [2],
45
47
  '@typescript-eslint/prefer-includes' : [1],
46
48
  '@typescript-eslint/prefer-nullish-coalescing' : [2],
@@ -73,6 +75,10 @@ module.exports = {
73
75
  allowKeywords: true,
74
76
  allowPattern : '[_-]',
75
77
  }],
78
+ 'prefer-destructuring' : [0],
79
+ '@typescript-eslint/prefer-destructuring' : [0],
80
+ 'prefer-promise-reject-errors' : [0],
81
+ '@typescript-eslint/prefer-promise-reject-errors' : [2],
76
82
  'require-await' : [0],
77
83
  '@typescript-eslint/require-await' : [2],
78
84
  'return-await' : [0],
package/rules/ts.js CHANGED
@@ -1,4 +1,4 @@
1
- // Rules up to v6.0
1
+ // Rules up to v6.19
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
@@ -73,7 +73,7 @@ module.exports = {
73
73
  'camelcase' : [0],
74
74
  // This only needs type info when using "types" selector,
75
75
  // see: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md#selector-options
76
- '@typescript-eslint/naming-convention' : [
76
+ '@typescript-eslint/naming-convention' : [
77
77
  2,
78
78
  {
79
79
  selector : 'variable',
@@ -109,18 +109,18 @@ module.exports = {
109
109
  format : ['PascalCase', 'UPPER_CASE'],
110
110
  },
111
111
  ],
112
- '@typescript-eslint/no-confusing-non-null-assertion' : [1],
113
- '@typescript-eslint/no-dynamic-delete' : [0],
114
- '@typescript-eslint/no-empty-interface' : [1],
115
- '@typescript-eslint/no-explicit-any' : [
112
+ '@typescript-eslint/no-confusing-non-null-assertion' : [1],
113
+ '@typescript-eslint/no-dynamic-delete' : [0],
114
+ '@typescript-eslint/no-empty-interface' : [0],
115
+ '@typescript-eslint/no-explicit-any' : [
116
116
  1,
117
117
  {
118
118
  fixToUnknown : false,
119
119
  ignoreRestArgs: true,
120
120
  },
121
121
  ],
122
- '@typescript-eslint/no-extra-non-null-assertion' : [1],
123
- '@typescript-eslint/no-extraneous-class' : [
122
+ '@typescript-eslint/no-extra-non-null-assertion' : [1],
123
+ '@typescript-eslint/no-extraneous-class' : [
124
124
  1,
125
125
  {
126
126
  allowConstructorOnly: false,
@@ -129,48 +129,50 @@ module.exports = {
129
129
  allowWithDecorator : false,
130
130
  },
131
131
  ],
132
- '@typescript-eslint/no-inferrable-types' : [0],
133
- '@typescript-eslint/no-invalid-void-type' : [0],
134
- '@typescript-eslint/no-misused-new' : [2],
135
- '@typescript-eslint/no-namespace' : [2],
136
- '@typescript-eslint/no-mixed-enums' : [0],
137
- '@typescript-eslint/no-non-null-asserted-optional-chain' : [2],
138
- '@typescript-eslint/no-non-null-assertion' : [1],
139
- '@typescript-eslint/no-require-imports' : [2],
140
- '@typescript-eslint/no-this-alias' : [1],
141
- '@typescript-eslint/no-type-alias' : [0],
142
- '@typescript-eslint/no-useless-empty-export' : [2],
143
- '@typescript-eslint/no-var-requires' : [2],
144
- '@typescript-eslint/prefer-as-const' : [2],
145
- '@typescript-eslint/prefer-enum-initializers' : [0],
146
- '@typescript-eslint/prefer-for-of' : [1],
147
- '@typescript-eslint/prefer-function-type' : [1],
148
- '@typescript-eslint/prefer-literal-enum-member' : [1, {allowBitwiseExpressions: true}],
149
- '@typescript-eslint/prefer-namespace-keyword' : [1],
150
- '@typescript-eslint/prefer-optional-chain' : [2],
151
- '@typescript-eslint/prefer-ts-expect-error' : [1],
152
- '@typescript-eslint/triple-slash-reference' : [
132
+ '@typescript-eslint/no-inferrable-types' : [0],
133
+ '@typescript-eslint/no-invalid-void-type' : [0],
134
+ '@typescript-eslint/no-misused-new' : [2],
135
+ '@typescript-eslint/no-namespace' : [2],
136
+ '@typescript-eslint/no-mixed-enums' : [0],
137
+ '@typescript-eslint/no-non-null-asserted-optional-chain': [2],
138
+ '@typescript-eslint/no-non-null-assertion' : [1],
139
+ '@typescript-eslint/no-require-imports' : [2],
140
+ '@typescript-eslint/no-this-alias' : [1],
141
+ '@typescript-eslint/no-type-alias' : [0],
142
+ '@typescript-eslint/no-useless-empty-export' : [2],
143
+ '@typescript-eslint/no-var-requires' : [2],
144
+ '@typescript-eslint/prefer-as-const' : [2],
145
+ '@typescript-eslint/prefer-enum-initializers' : [0],
146
+ '@typescript-eslint/prefer-for-of' : [1],
147
+ '@typescript-eslint/prefer-function-type' : [1],
148
+ '@typescript-eslint/prefer-literal-enum-member' : [1, {allowBitwiseExpressions: true}],
149
+ '@typescript-eslint/prefer-namespace-keyword' : [1],
150
+ '@typescript-eslint/prefer-optional-chain' : [2],
151
+ '@typescript-eslint/prefer-ts-expect-error' : [1],
152
+ '@typescript-eslint/triple-slash-reference' : [
153
153
  1,
154
154
  {path: 'never', types: 'prefer-import', lib: 'never'},
155
155
  ],
156
- '@typescript-eslint/type-annotation-spacing' : [2],
156
+ '@typescript-eslint/type-annotation-spacing' : [2],
157
157
  // @see Note in https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/typedef.md
158
158
  '@typescript-eslint/typedef' : [0],
159
159
  '@typescript-eslint/unified-signatures': [1],
160
160
 
161
161
  // Overrides ESLint rules
162
162
  // ----------------------
163
- 'brace-style' : [0],
164
- '@typescript-eslint/brace-style' : [2, '1tbs', {allowSingleLine: true}],
165
- 'comma-dangle' : [0],
166
- '@typescript-eslint/comma-dangle' : [2, 'always-multiline'],
167
- 'comma-spacing' : [0],
168
- '@typescript-eslint/comma-spacing' : [2],
169
- 'default-param-last' : [0],
170
- '@typescript-eslint/default-param-last': [2],
171
- 'func-call-spacing' : [0],
172
- '@typescript-eslint/func-call-spacing' : [2, 'never'],
173
- 'indent' : [0],
163
+ 'brace-style' : [0],
164
+ '@typescript-eslint/brace-style' : [2, '1tbs', {allowSingleLine: true}],
165
+ 'class-methods-use-this' : [0],
166
+ '@typescript-eslint/class-methods-use-this': [0],
167
+ 'comma-dangle' : [0],
168
+ '@typescript-eslint/comma-dangle' : [2, 'always-multiline'],
169
+ 'comma-spacing' : [0],
170
+ '@typescript-eslint/comma-spacing' : [2],
171
+ 'default-param-last' : [0],
172
+ '@typescript-eslint/default-param-last' : [2],
173
+ 'func-call-spacing' : [0],
174
+ '@typescript-eslint/func-call-spacing' : [2, 'never'],
175
+ 'indent' : [0],
174
176
  // Leave this to IDEA
175
177
  '@typescript-eslint/indent' : [
176
178
  0,
package/web-solid.js ADDED
@@ -0,0 +1,20 @@
1
+ module.exports = {
2
+ extends: [
3
+ './web-others',
4
+ ],
5
+
6
+ overrides: [
7
+ {
8
+ files : [
9
+ 'src/**/*.ts',
10
+ 'src/**/*.tsx',
11
+ ],
12
+ excludedFiles: [
13
+ 'src/**/*.spec.ts',
14
+ ],
15
+ extends : [
16
+ './rules/solid',
17
+ ],
18
+ },
19
+ ],
20
+ }