@foray1010/eslint-config 6.4.0 → 7.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 CHANGED
@@ -3,6 +3,37 @@
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.1.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.0.1...@foray1010/eslint-config@7.1.0) (2022-06-14)
7
+
8
+ ### Features
9
+
10
+ - avoid unnecessary closing tags ([602dd20](https://github.com/foray1010/common-presets/commit/602dd2071393ee0ee584eba06de9cb122a91b203))
11
+
12
+ ## [7.0.1](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.0.0...@foray1010/eslint-config@7.0.1) (2022-06-13)
13
+
14
+ ### Bug Fixes
15
+
16
+ - should drop node 17 in version range ([0e911fd](https://github.com/foray1010/common-presets/commit/0e911fd737e472d699bfc32d866067ed6ccfa269))
17
+
18
+ ## [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)
19
+
20
+ ### ⚠ BREAKING CHANGES
21
+
22
+ - drop eslint 7
23
+ - drop node 12 and 17
24
+
25
+ ### Bug Fixes
26
+
27
+ - **deps:** update dependency eslint-plugin-jsdoc to v39 ([f868271](https://github.com/foray1010/common-presets/commit/f8682716ee922a6a517d5c0173390dec0bd2e346))
28
+ - reenable import/named ([62fe238](https://github.com/foray1010/common-presets/commit/62fe2389b852749d63735b02e4898708a132b522))
29
+ - reenable no-floating-promises for test files ([3a03ad8](https://github.com/foray1010/common-presets/commit/3a03ad8e13f2b2440babc96880cd290f4ea6b386))
30
+ - replace eslint-plugin-node by eslint-plugin-n ([764320c](https://github.com/foray1010/common-presets/commit/764320cc26795c245008ce5bdbb87662e5dbae60))
31
+
32
+ ### Miscellaneous Chores
33
+
34
+ - drop eslint 7 ([543fd6a](https://github.com/foray1010/common-presets/commit/543fd6a702596e5e447a0797a4713d2f08478ecb))
35
+ - drop node 12 and 17 ([c43351e](https://github.com/foray1010/common-presets/commit/c43351e0da92209fc3100d9cb1bc129af320fdac))
36
+
6
37
  ## [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
38
 
8
39
  ### 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": "6.4.0",
4
+ "version": "7.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": {
@@ -20,7 +20,7 @@
20
20
  "eslintignore"
21
21
  ],
22
22
  "dependencies": {
23
- "@foray1010/common-presets-utils": "^4.0.0",
23
+ "@foray1010/common-presets-utils": "^5.0.1",
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": "^38.0.0",
34
- "eslint-plugin-node": "^11.1.0",
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": ">=7.28.0 <9",
43
- "prettier": ">=2 <3"
42
+ "eslint": "^8.0.0",
43
+ "prettier": "^2.0.0"
44
44
  },
45
45
  "engines": {
46
- "node": "^12.22.0 || ^14.17.0 || >=16.13.0"
46
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "d6a5e814c1bccdcdd2a8a6c5de9036ca14cac6d4"
51
+ "gitHead": "575dc4e4b5d4d3cbb4f2a66f482baffa7655c1b5"
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/errors',
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
- typedefs: true,
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-node'],
4
+ plugins: ['eslint-plugin-n'],
5
5
  env: {
6
6
  node: true,
7
7
  },
8
8
  rules: {
9
9
  // disallow deprecated node APIs
10
- 'node/no-deprecated-api': 'error',
10
+ 'n/no-deprecated-api': 'error',
11
11
  // disallow the assignment to `exports`
12
- 'node/no-exports-assign': 'error',
12
+ 'n/no-exports-assign': 'error',
13
13
  // disallow `bin` files that npm ignores
14
- 'node/no-unpublished-bin': 'error',
14
+ 'n/no-unpublished-bin': 'error',
15
15
  // disallow unsupported Node.js built-in APIs on the specified version
16
- 'node/no-unsupported-features/node-builtins': 'error',
16
+ 'n/no-unsupported-features/node-builtins': 'error',
17
17
  // make `process.exit()` expressions the same code path as `throw`
18
- 'node/process-exit-as-throw': 'error',
18
+ 'n/process-exit-as-throw': 'error',
19
19
  // enforce shebang on the entry bin file
20
- 'node/shebang': 'error',
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,8 @@ 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
+ // avoid unnecessary closing tags
47
+ 'react/self-closing-comp': 'error',
46
48
  'react-hooks/exhaustive-deps': [
47
49
  'error',
48
50
  {