@foray1010/eslint-config 9.0.0 → 9.1.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/package.json +3 -3
- package/presets/base.cjs +13 -5
- package/presets/react.cjs +2 -0
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
|
+
## [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)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** make sure private class members are in-use ([8d01342](https://github.com/foray1010/common-presets/commit/8d01342664696ab6bff9cc2f703bc53a81995ed5))
|
|
11
|
+
- **eslint-config:** prefer `const` when the variable won't be reassigned ([e6b18a1](https://github.com/foray1010/common-presets/commit/e6b18a1dcc023ea346d96288f4c709b77578b2af))
|
|
12
|
+
- **eslint-config:** prefer explicitly convert type for readability ([2b5f647](https://github.com/foray1010/common-presets/commit/2b5f64740415361173f0ca16a91c2714af72ed02))
|
|
13
|
+
- **eslint-config:** require button type to avoid unexpected form submits ([891ff50](https://github.com/foray1010/common-presets/commit/891ff506217da96accd030fbbbea680569f4573b))
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- **deps:** update dependency eslint-plugin-unicorn to v45 ([cde868a](https://github.com/foray1010/common-presets/commit/cde868a7c95aaa4dad3acedb07a763ccc64582c9))
|
|
18
|
+
|
|
19
|
+
## [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)
|
|
20
|
+
|
|
21
|
+
### Reverts
|
|
22
|
+
|
|
23
|
+
- **eslint-config:** does not report error when importing ts files without extension ([faeee28](https://github.com/foray1010/common-presets/commit/faeee281cd40ba6b22835ae5b8c9cd6d69d3815e))
|
|
24
|
+
|
|
6
25
|
## [9.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@8.0.1...@foray1010/eslint-config@9.0.0) (2022-11-07)
|
|
7
26
|
|
|
8
27
|
### ⚠ BREAKING CHANGES
|
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.
|
|
4
|
+
"version": "9.1.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": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
44
44
|
"eslint-plugin-simple-import-sort": "^8.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",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "7b07434790f3f2c119d1106c379ab07bd715372e"
|
|
63
63
|
}
|
package/presets/base.cjs
CHANGED
|
@@ -71,7 +71,6 @@ module.exports = {
|
|
|
71
71
|
'func-names': ['error', 'as-needed'],
|
|
72
72
|
// this rule doesn't support commonjs, some dependencies are using commonjs
|
|
73
73
|
'import/default': 'off',
|
|
74
|
-
// use with `n/file-extension-in-import`
|
|
75
74
|
// enforce extensions for both cjs and esm
|
|
76
75
|
'import/extensions': [
|
|
77
76
|
'error',
|
|
@@ -79,7 +78,7 @@ module.exports = {
|
|
|
79
78
|
'always',
|
|
80
79
|
{
|
|
81
80
|
pattern: {
|
|
82
|
-
//
|
|
81
|
+
// eslint-plugin-import does not support checking es modules in typescript files
|
|
83
82
|
cts: 'never',
|
|
84
83
|
mts: 'never',
|
|
85
84
|
ts: 'never',
|
|
@@ -138,8 +137,20 @@ module.exports = {
|
|
|
138
137
|
'jsdoc/require-jsdoc': 'off',
|
|
139
138
|
// does not work well with TypeScript https://github.com/gajus/eslint-plugin-jsdoc/issues/145
|
|
140
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',
|
|
141
144
|
// avoid assigning anonymous function to object key which is harder to trace when debug
|
|
142
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
|
+
],
|
|
143
154
|
// use with `unicorn/throw-new-error`
|
|
144
155
|
// disallow builtins to be created without `new` operator, to be consistent with es6 class syntax
|
|
145
156
|
'unicorn/new-for-builtins': 'error',
|
|
@@ -205,7 +216,6 @@ module.exports = {
|
|
|
205
216
|
'@typescript-eslint/eslint-plugin',
|
|
206
217
|
'eslint-plugin-deprecation',
|
|
207
218
|
'eslint-plugin-functional',
|
|
208
|
-
'eslint-plugin-n',
|
|
209
219
|
],
|
|
210
220
|
rules: {
|
|
211
221
|
// extend existing rule
|
|
@@ -316,8 +326,6 @@ module.exports = {
|
|
|
316
326
|
],
|
|
317
327
|
// forbid unnecessary callback wrapper
|
|
318
328
|
'functional/prefer-tacit': 'error',
|
|
319
|
-
// use with `import/extensions` because it doesn't work with TypeScript
|
|
320
|
-
'n/file-extension-in-import': ['error', 'always'],
|
|
321
329
|
'no-restricted-syntax': [
|
|
322
330
|
'error',
|
|
323
331
|
{
|