@foray1010/eslint-config 6.4.0 → 7.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 +21 -0
- package/package.json +8 -8
- package/presets/base.js +10 -7
- package/presets/node.js +7 -7
- package/presets/react.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
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
|
+
## [7.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@6.4.0...@foray1010/eslint-config@7.0.0) (2022-06-13)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- drop support for typescript >=5
|
|
11
|
+
- drop eslint 7
|
|
12
|
+
- drop node 12 and 17
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **deps:** update dependency eslint-plugin-jsdoc to v39 ([f868271](https://github.com/foray1010/common-presets/commit/f8682716ee922a6a517d5c0173390dec0bd2e346))
|
|
17
|
+
- reenable import/named ([62fe238](https://github.com/foray1010/common-presets/commit/62fe2389b852749d63735b02e4898708a132b522))
|
|
18
|
+
- reenable no-floating-promises for test files ([3a03ad8](https://github.com/foray1010/common-presets/commit/3a03ad8e13f2b2440babc96880cd290f4ea6b386))
|
|
19
|
+
- replace eslint-plugin-node by eslint-plugin-n ([764320c](https://github.com/foray1010/common-presets/commit/764320cc26795c245008ce5bdbb87662e5dbae60))
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
- drop eslint 7 ([543fd6a](https://github.com/foray1010/common-presets/commit/543fd6a702596e5e447a0797a4713d2f08478ecb))
|
|
24
|
+
- drop node 12 and 17 ([c43351e](https://github.com/foray1010/common-presets/commit/c43351e0da92209fc3100d9cb1bc129af320fdac))
|
|
25
|
+
- remove peerDependencies versions that are not sure if supported ([2175adb](https://github.com/foray1010/common-presets/commit/2175adb62efe7d1762f6f66ce9bb0e7adb5f82e5))
|
|
26
|
+
|
|
6
27
|
## [6.4.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@6.3.1...@foray1010/eslint-config@6.4.0) (2022-04-25)
|
|
7
28
|
|
|
8
29
|
### Features
|
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": "7.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,7 +20,7 @@
|
|
|
20
20
|
"eslintignore"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@foray1010/common-presets-utils": "^
|
|
23
|
+
"@foray1010/common-presets-utils": "^5.0.0",
|
|
24
24
|
"@typescript-eslint/eslint-plugin": "^5.13.0",
|
|
25
25
|
"@typescript-eslint/parser": "^5.13.0",
|
|
26
26
|
"confusing-browser-globals": "^1.0.10",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"eslint-plugin-import": "^2.22.1",
|
|
31
31
|
"eslint-plugin-jest": "^26.0.0",
|
|
32
32
|
"eslint-plugin-jest-dom": "^4.0.0",
|
|
33
|
-
"eslint-plugin-jsdoc": "^
|
|
34
|
-
"eslint-plugin-
|
|
33
|
+
"eslint-plugin-jsdoc": "^39.0.0",
|
|
34
|
+
"eslint-plugin-n": "^15.2.2",
|
|
35
35
|
"eslint-plugin-prettier": "^4.0.0",
|
|
36
36
|
"eslint-plugin-react": "^7.23.2",
|
|
37
37
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"eslint-plugin-testing-library": "^5.3.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"eslint": "
|
|
43
|
-
"prettier": "
|
|
42
|
+
"eslint": "^8.0.0",
|
|
43
|
+
"prettier": "^2.0.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
|
-
"node": "^
|
|
46
|
+
"node": "^14.17.0 || >=16.13.0 || >=18.0.0"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6b2dbe64ac8e4677dfb6b72f70e185bcd607f17b"
|
|
52
52
|
}
|
package/presets/base.js
CHANGED
|
@@ -16,8 +16,7 @@ module.exports = {
|
|
|
16
16
|
extends: [
|
|
17
17
|
'eslint:recommended',
|
|
18
18
|
'plugin:eslint-comments/recommended',
|
|
19
|
-
'plugin:import/
|
|
20
|
-
'plugin:import/warnings',
|
|
19
|
+
'plugin:import/recommended',
|
|
21
20
|
'plugin:jsdoc/recommended',
|
|
22
21
|
'plugin:prettier/recommended',
|
|
23
22
|
'eslint-config-prettier',
|
|
@@ -47,8 +46,6 @@ module.exports = {
|
|
|
47
46
|
'import/default': 'off',
|
|
48
47
|
// make sure import statements above the others
|
|
49
48
|
'import/first': 'error',
|
|
50
|
-
// doesn't work with redux-saga/effects
|
|
51
|
-
'import/named': 'off',
|
|
52
49
|
// separate import statements from the others
|
|
53
50
|
'import/newline-after-import': 'error',
|
|
54
51
|
// avoid anonymous function or class for easier to debug via stack trace
|
|
@@ -192,10 +189,18 @@ module.exports = {
|
|
|
192
189
|
'@typescript-eslint/no-use-before-define': [
|
|
193
190
|
'error',
|
|
194
191
|
{
|
|
192
|
+
/* options from eslint/no-use-before-define */
|
|
193
|
+
// allow use function before defined as they could be hoisted
|
|
195
194
|
functions: false,
|
|
196
195
|
classes: true,
|
|
197
196
|
variables: true,
|
|
198
|
-
|
|
197
|
+
|
|
198
|
+
/* options from @typescript-eslint/no-use-before-define */
|
|
199
|
+
enums: true,
|
|
200
|
+
// confusing option, it will disable `typedefs`
|
|
201
|
+
ignoreTypeReferences: false,
|
|
202
|
+
// tsc allows types to be used before define
|
|
203
|
+
typedefs: false,
|
|
199
204
|
},
|
|
200
205
|
],
|
|
201
206
|
// fault alarms in 4.29.3
|
|
@@ -210,8 +215,6 @@ module.exports = {
|
|
|
210
215
|
{
|
|
211
216
|
files: testFileGlobs,
|
|
212
217
|
rules: {
|
|
213
|
-
// testing-library's `act` may or may not response promise, this rule produces false alarm
|
|
214
|
-
'@typescript-eslint/no-floating-promises': 'off',
|
|
215
218
|
// doesn't work with jest.fn<void>()
|
|
216
219
|
'@typescript-eslint/no-invalid-void-type': 'off',
|
|
217
220
|
},
|
package/presets/node.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
plugins: ['eslint-plugin-
|
|
4
|
+
plugins: ['eslint-plugin-n'],
|
|
5
5
|
env: {
|
|
6
6
|
node: true,
|
|
7
7
|
},
|
|
8
8
|
rules: {
|
|
9
9
|
// disallow deprecated node APIs
|
|
10
|
-
'
|
|
10
|
+
'n/no-deprecated-api': 'error',
|
|
11
11
|
// disallow the assignment to `exports`
|
|
12
|
-
'
|
|
12
|
+
'n/no-exports-assign': 'error',
|
|
13
13
|
// disallow `bin` files that npm ignores
|
|
14
|
-
'
|
|
14
|
+
'n/no-unpublished-bin': 'error',
|
|
15
15
|
// disallow unsupported Node.js built-in APIs on the specified version
|
|
16
|
-
'
|
|
16
|
+
'n/no-unsupported-features/node-builtins': 'error',
|
|
17
17
|
// make `process.exit()` expressions the same code path as `throw`
|
|
18
|
-
'
|
|
18
|
+
'n/process-exit-as-throw': 'error',
|
|
19
19
|
// enforce shebang on the entry bin file
|
|
20
|
-
'
|
|
20
|
+
'n/shebang': 'error',
|
|
21
21
|
},
|
|
22
22
|
}
|
package/presets/react.js
CHANGED
|
@@ -6,6 +6,7 @@ module.exports = {
|
|
|
6
6
|
extends: [
|
|
7
7
|
'plugin:react/recommended',
|
|
8
8
|
'plugin:react/jsx-runtime',
|
|
9
|
+
'plugin:react-hooks/recommended',
|
|
9
10
|
'eslint-config-prettier',
|
|
10
11
|
],
|
|
11
12
|
parserOptions: {
|
|
@@ -42,7 +43,6 @@ module.exports = {
|
|
|
42
43
|
],
|
|
43
44
|
// rely on typescript instead, and it does not work well with types that are imported from elsewhere
|
|
44
45
|
'react/prop-types': 'off',
|
|
45
|
-
'react-hooks/rules-of-hooks': 'error',
|
|
46
46
|
'react-hooks/exhaustive-deps': [
|
|
47
47
|
'error',
|
|
48
48
|
{
|