@foray1010/eslint-config 9.0.1 → 9.2.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 +25 -0
- package/package.json +8 -8
- package/presets/base.cjs +18 -2
- package/presets/react.cjs +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
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
|
+
## [9.2.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@9.1.0...@foray1010/eslint-config@9.2.0) (2023-02-25)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** avoid type imports with side effects ([ceda72a](https://github.com/foray1010/common-presets/commit/ceda72a42dab09540fe796cca7c88b82801f073d))
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **deps:** update dependency eslint-plugin-jsdoc to v40 ([9d2a01e](https://github.com/foray1010/common-presets/commit/9d2a01e04880e21c2be8dd2e984ec5f01f28fcda))
|
|
15
|
+
- **deps:** update dependency eslint-plugin-simple-import-sort to v10 ([5b258d7](https://github.com/foray1010/common-presets/commit/5b258d70b6c6f344645f983d6f7805edd2ee1908))
|
|
16
|
+
- **deps:** update dependency eslint-plugin-simple-import-sort to v9 ([62d76f2](https://github.com/foray1010/common-presets/commit/62d76f2d2ef83ab5a909d3820a9f16acf387bbfa))
|
|
17
|
+
|
|
18
|
+
## [9.1.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@9.0.1...@foray1010/eslint-config@9.1.0) (2022-12-21)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- **eslint-config:** make sure private class members are in-use ([8d01342](https://github.com/foray1010/common-presets/commit/8d01342664696ab6bff9cc2f703bc53a81995ed5))
|
|
23
|
+
- **eslint-config:** prefer `const` when the variable won't be reassigned ([e6b18a1](https://github.com/foray1010/common-presets/commit/e6b18a1dcc023ea346d96288f4c709b77578b2af))
|
|
24
|
+
- **eslint-config:** prefer explicitly convert type for readability ([2b5f647](https://github.com/foray1010/common-presets/commit/2b5f64740415361173f0ca16a91c2714af72ed02))
|
|
25
|
+
- **eslint-config:** require button type to avoid unexpected form submits ([891ff50](https://github.com/foray1010/common-presets/commit/891ff506217da96accd030fbbbea680569f4573b))
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
- **deps:** update dependency eslint-plugin-unicorn to v45 ([cde868a](https://github.com/foray1010/common-presets/commit/cde868a7c95aaa4dad3acedb07a763ccc64582c9))
|
|
30
|
+
|
|
6
31
|
## [9.0.1](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@9.0.0...@foray1010/eslint-config@9.0.1) (2022-11-07)
|
|
7
32
|
|
|
8
33
|
### Reverts
|
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": "9.0
|
|
4
|
+
"version": "9.2.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": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@foray1010/common-presets-utils": "^6.0.0",
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
28
|
-
"@typescript-eslint/parser": "^5.
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
|
28
|
+
"@typescript-eslint/parser": "^5.51.0",
|
|
29
29
|
"confusing-browser-globals": "^1.0.10",
|
|
30
30
|
"eslint-config-prettier": "^8.3.0",
|
|
31
31
|
"eslint-import-resolver-typescript": "^3.5.2",
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
"eslint-plugin-import": "^2.22.1",
|
|
37
37
|
"eslint-plugin-jest": "^27.1.3",
|
|
38
38
|
"eslint-plugin-jest-dom": "^4.0.0",
|
|
39
|
-
"eslint-plugin-jsdoc": "^
|
|
39
|
+
"eslint-plugin-jsdoc": "^40.0.0",
|
|
40
40
|
"eslint-plugin-n": "^15.3.0",
|
|
41
41
|
"eslint-plugin-prettier": "^4.0.0",
|
|
42
42
|
"eslint-plugin-react": "^7.31.10",
|
|
43
43
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
44
|
-
"eslint-plugin-simple-import-sort": "^
|
|
44
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
45
45
|
"eslint-plugin-testing-library": "^5.9.1",
|
|
46
|
-
"eslint-plugin-unicorn": "^
|
|
46
|
+
"eslint-plugin-unicorn": "^45.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/confusing-browser-globals": "1.0.0",
|
|
50
|
-
"@types/eslint": "8.
|
|
50
|
+
"@types/eslint": "8.21.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"eslint": "^8.0.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "11a76b57489f7de8f08ec5cd47f8747c4c432f09"
|
|
63
63
|
}
|
package/presets/base.cjs
CHANGED
|
@@ -137,8 +137,20 @@ module.exports = {
|
|
|
137
137
|
'jsdoc/require-jsdoc': 'off',
|
|
138
138
|
// does not work well with TypeScript https://github.com/gajus/eslint-plugin-jsdoc/issues/145
|
|
139
139
|
'jsdoc/valid-types': 'off',
|
|
140
|
+
// prefer explicitly convert type for readability
|
|
141
|
+
'no-implicit-coercion': 'error',
|
|
142
|
+
// make sure private class members are in-use
|
|
143
|
+
'no-unused-private-class-members': 'error',
|
|
140
144
|
// avoid assigning anonymous function to object key which is harder to trace when debug
|
|
141
145
|
'object-shorthand': ['error', 'always'],
|
|
146
|
+
// prefer `const` when the variable won't be reassigned
|
|
147
|
+
'prefer-const': [
|
|
148
|
+
'error',
|
|
149
|
+
{
|
|
150
|
+
// if one of the variables will be reassigned, do not enforce `const`
|
|
151
|
+
destructuring: 'all',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
142
154
|
// use with `unicorn/throw-new-error`
|
|
143
155
|
// disallow builtins to be created without `new` operator, to be consistent with es6 class syntax
|
|
144
156
|
'unicorn/new-for-builtins': 'error',
|
|
@@ -219,10 +231,12 @@ module.exports = {
|
|
|
219
231
|
],
|
|
220
232
|
// separate type exports which allow certain optimizations within compilers
|
|
221
233
|
'@typescript-eslint/consistent-type-exports': 'error',
|
|
222
|
-
// separate type imports which allow certain optimizations within compilers
|
|
223
234
|
'@typescript-eslint/consistent-type-imports': [
|
|
224
235
|
'error',
|
|
225
|
-
{
|
|
236
|
+
{
|
|
237
|
+
// separate type imports which allow certain optimizations within compilers
|
|
238
|
+
prefer: 'type-imports',
|
|
239
|
+
},
|
|
226
240
|
],
|
|
227
241
|
// disable the base rule as it can report incorrect errors, use @typescript-eslint/dot-notation instead
|
|
228
242
|
'dot-notation': 'off',
|
|
@@ -248,6 +262,8 @@ module.exports = {
|
|
|
248
262
|
'@typescript-eslint/no-empty-function': 'off',
|
|
249
263
|
// encourage to check error type before use in catch clauses
|
|
250
264
|
'@typescript-eslint/no-implicit-any-catch': 'error',
|
|
265
|
+
// 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
|
|
266
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
251
267
|
// enforce correct usage of `void` type
|
|
252
268
|
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
253
269
|
// allow using async function as event handler in frontend
|