@foray1010/eslint-config 13.0.3 → 14.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/CHANGELOG.md +19 -0
- package/bases/base.mjs +9 -27
- package/package.json +23 -24
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [14.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@13.0.3...@foray1010/eslint-config@14.0.0) (2025-03-11)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- **deps:** require nodejs `^20.10.0 || >=22.11.0`
|
|
11
|
+
- **deps:** require eslint `^9.21.0`
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **eslint-config:** forbid ts enum ([7613ca0](https://github.com/foray1010/common-presets/commit/7613ca06b492dc5f71d562a1ce5b9810b60ab46f))
|
|
16
|
+
- **eslint-config:** report unused disable directives and inline configs ([7bcd4d2](https://github.com/foray1010/common-presets/commit/7bcd4d264826c2c8640c6ad6bed9083761432410))
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- **deps:** update dependency eslint-plugin-functional to v9 ([e1a3751](https://github.com/foray1010/common-presets/commit/e1a3751a4e14d9bde401643be837f98877898129))
|
|
21
|
+
- **deps:** update dependency eslint-plugin-unicorn to v9 ([c679289](https://github.com/foray1010/common-presets/commit/c679289daa61df03cde537947a7c0f51935ff626))
|
|
22
|
+
- **eslint-config:** remove duplicated typescript-eslint rules ([df34e55](https://github.com/foray1010/common-presets/commit/df34e5519ac288b552e06b6d7cd00b6fb2928085))
|
|
23
|
+
- **eslint-config:** update dependencies ([b88f45c](https://github.com/foray1010/common-presets/commit/b88f45cc4cc78a45525e329c059e64940f717687))
|
|
24
|
+
|
|
6
25
|
## [13.0.3](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@13.0.2...@foray1010/eslint-config@13.0.3) (2025-01-19)
|
|
7
26
|
|
|
8
27
|
### Bug Fixes
|
package/bases/base.mjs
CHANGED
|
@@ -87,14 +87,8 @@ async function generateTypeScriptConfig() {
|
|
|
87
87
|
accessibility: 'explicit',
|
|
88
88
|
},
|
|
89
89
|
],
|
|
90
|
-
// sometimes auto detect can provide a better and narrower type
|
|
91
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
92
90
|
// do not allow usage of deprecated code
|
|
93
91
|
'@typescript-eslint/no-deprecated': 'error',
|
|
94
|
-
// disallow duplicated value in enum as it is error-prone
|
|
95
|
-
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
96
|
-
// need empty function for react context default value
|
|
97
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
98
92
|
// TypeScript team suggests to use `<T extends {}>` https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#unconstrained-generics-no-longer-assignable-to
|
|
99
93
|
'@typescript-eslint/no-empty-object-type': 'off',
|
|
100
94
|
// when using typescript 5.0 with verbatimModuleSyntax flag on, compiler will not remove import statements with only inline type imports which lead to side effects
|
|
@@ -106,15 +100,6 @@ async function generateTypeScriptConfig() {
|
|
|
106
100
|
'error',
|
|
107
101
|
{ checksVoidReturn: false },
|
|
108
102
|
],
|
|
109
|
-
// declaration merging between classes and interfaces is unsafe
|
|
110
|
-
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
111
|
-
'@typescript-eslint/no-unused-vars': [
|
|
112
|
-
'error',
|
|
113
|
-
{
|
|
114
|
-
// error is optional now
|
|
115
|
-
caughtErrors: 'all',
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
103
|
// do not block functions referring to other functions
|
|
119
104
|
'@typescript-eslint/no-use-before-define': [
|
|
120
105
|
'error',
|
|
@@ -126,7 +111,6 @@ async function generateTypeScriptConfig() {
|
|
|
126
111
|
variables: true,
|
|
127
112
|
|
|
128
113
|
/* options from @typescript-eslint/no-use-before-define */
|
|
129
|
-
enums: true,
|
|
130
114
|
// confusing option, it will disable `typedefs`
|
|
131
115
|
ignoreTypeReferences: false,
|
|
132
116
|
// tsc allows types to be used before define
|
|
@@ -135,17 +119,6 @@ async function generateTypeScriptConfig() {
|
|
|
135
119
|
],
|
|
136
120
|
// make sure functions which return a promise will just return a rejected promise instead of throwing an error
|
|
137
121
|
'@typescript-eslint/promise-function-async': 'error',
|
|
138
|
-
// allow primitive value in template string
|
|
139
|
-
'@typescript-eslint/restrict-template-expressions': [
|
|
140
|
-
'error',
|
|
141
|
-
{
|
|
142
|
-
allowNumber: true,
|
|
143
|
-
allowBoolean: true,
|
|
144
|
-
allowAny: true, // mistakenly recognize string as any in 4.29.3
|
|
145
|
-
allowNullish: true,
|
|
146
|
-
allowRegExp: true,
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
122
|
// avoid missed switch-case by requiring switch-case statements to be exhaustive with union type
|
|
150
123
|
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
151
124
|
// ignore static function as those are not supposed to use `this`
|
|
@@ -200,6 +173,11 @@ async function generateTypeScriptConfig() {
|
|
|
200
173
|
message:
|
|
201
174
|
'Use #private instead (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields)',
|
|
202
175
|
},
|
|
176
|
+
{
|
|
177
|
+
selector: 'TSEnumDeclaration',
|
|
178
|
+
message:
|
|
179
|
+
'"Use string literals with unions or `as const` instead because they work with Node.js type stripping, see https://news.ycombinator.com/item?id=42767627',
|
|
180
|
+
},
|
|
203
181
|
],
|
|
204
182
|
// @typescript-eslint/eslint-plugin suggests to disable it: https://github.com/typescript-eslint/typescript-eslint/blob/2588e9ea55f78352fdd6ae92a306135aabb49a1a/docs/linting/TROUBLESHOOTING.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
|
|
205
183
|
// It is disabled in recommended config but re-enabled here to enforce a subset of global variables that supported by both node.js and browsers
|
|
@@ -331,6 +309,10 @@ const baseConfig = [
|
|
|
331
309
|
},
|
|
332
310
|
},
|
|
333
311
|
{
|
|
312
|
+
linterOptions: {
|
|
313
|
+
reportUnusedDisableDirectives: 'error',
|
|
314
|
+
reportUnusedInlineConfigs: 'error',
|
|
315
|
+
},
|
|
334
316
|
languageOptions: {
|
|
335
317
|
ecmaVersion: 2023,
|
|
336
318
|
globals: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@foray1010/eslint-config",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "14.0.0",
|
|
5
5
|
"homepage": "https://github.com/foray1010/common-presets/tree/master/packages/eslint-config#readme",
|
|
6
6
|
"bugs": "https://github.com/foray1010/common-presets/issues",
|
|
7
7
|
"repository": {
|
|
@@ -20,36 +20,35 @@
|
|
|
20
20
|
"type:check": "tsc"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.
|
|
24
|
-
"@eslint/js": "^9.
|
|
23
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
24
|
+
"@eslint/js": "^9.21.0",
|
|
25
25
|
"@foray1010/common-presets-utils": "^8.0.0",
|
|
26
26
|
"confusing-browser-globals": "^1.0.11",
|
|
27
|
-
"eslint-config-prettier": "^10.0.
|
|
28
|
-
"eslint-import-resolver-typescript": "^3.
|
|
29
|
-
"eslint-plugin-compat": "^6.0.
|
|
30
|
-
"eslint-plugin-functional": "^
|
|
31
|
-
"eslint-plugin-import-x": "^4.1
|
|
32
|
-
"eslint-plugin-jest": "^28.
|
|
33
|
-
"eslint-plugin-jest-dom": "^5.
|
|
34
|
-
"eslint-plugin-n": "^17.
|
|
35
|
-
"eslint-plugin-prettier": "^5.2.
|
|
36
|
-
"eslint-plugin-react": "^7.
|
|
37
|
-
"eslint-plugin-react-hooks": "^5.
|
|
38
|
-
"eslint-plugin-regexp": "^2.
|
|
27
|
+
"eslint-config-prettier": "^10.0.2",
|
|
28
|
+
"eslint-import-resolver-typescript": "^3.8.3",
|
|
29
|
+
"eslint-plugin-compat": "^6.0.2",
|
|
30
|
+
"eslint-plugin-functional": "^9.0.1",
|
|
31
|
+
"eslint-plugin-import-x": "^4.6.1",
|
|
32
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
33
|
+
"eslint-plugin-jest-dom": "^5.5.0",
|
|
34
|
+
"eslint-plugin-n": "^17.15.1",
|
|
35
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
36
|
+
"eslint-plugin-react": "^7.37.4",
|
|
37
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
38
|
+
"eslint-plugin-regexp": "^2.7.0",
|
|
39
39
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
40
|
-
"eslint-plugin-testing-library": "^7.
|
|
41
|
-
"eslint-plugin-unicorn": "^
|
|
42
|
-
"globals": "^
|
|
43
|
-
"typescript-eslint": "^8.
|
|
40
|
+
"eslint-plugin-testing-library": "^7.1.1",
|
|
41
|
+
"eslint-plugin-unicorn": "^57.0.0",
|
|
42
|
+
"globals": "^16.0.0",
|
|
43
|
+
"typescript-eslint": "^8.25.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/confusing-browser-globals": "1.0.3",
|
|
47
|
-
"@types/eslint": "9.6.1"
|
|
48
|
-
"@types/eslint__js": "8.42.3"
|
|
47
|
+
"@types/eslint": "9.6.1"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"@testing-library/dom": "^10.0.0",
|
|
52
|
-
"eslint": "^9.
|
|
51
|
+
"eslint": "^9.21.0",
|
|
53
52
|
"prettier": "^3.0.0",
|
|
54
53
|
"typescript": "^5.0.2"
|
|
55
54
|
},
|
|
@@ -62,10 +61,10 @@
|
|
|
62
61
|
}
|
|
63
62
|
},
|
|
64
63
|
"engines": {
|
|
65
|
-
"node": "^
|
|
64
|
+
"node": "^20.10.0 || >=22.11.0"
|
|
66
65
|
},
|
|
67
66
|
"publishConfig": {
|
|
68
67
|
"access": "public"
|
|
69
68
|
},
|
|
70
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "7ab2a92cce9564e8f577500663a09ab3a75641ed"
|
|
71
70
|
}
|