@foray1010/eslint-config 7.7.2 → 7.8.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 +13 -0
- package/package.json +5 -4
- package/presets/base.js +4 -2
- package/presets/node.js +12 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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.8.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.7.3...@foray1010/eslint-config@7.8.0) (2022-10-03)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** prefer Number static properties over global ones ([532df43](https://github.com/foray1010/common-presets/commit/532df43987f464ea3f3cfe1e5507b1077e14bced))
|
|
11
|
+
- **eslint-config:** re-enable functional/prefer-tacit ([9f312cc](https://github.com/foray1010/common-presets/commit/9f312cc3ac05429a969f271c46e02d915bf44e41))
|
|
12
|
+
|
|
13
|
+
## [7.7.3](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.7.2...@foray1010/eslint-config@7.7.3) (2022-10-02)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- **eslint-config:** prefer isomorphic global variables ([fa098bc](https://github.com/foray1010/common-presets/commit/fa098bc9890d86facd9c592f1ed42515bc94d2af))
|
|
18
|
+
|
|
6
19
|
## [7.7.2](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@7.7.1...@foray1010/eslint-config@7.7.2) (2022-10-01)
|
|
7
20
|
|
|
8
21
|
### Bug Fixes
|
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": "7.
|
|
4
|
+
"version": "7.8.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": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"eslint-config-prettier": "^8.3.0",
|
|
31
31
|
"eslint-plugin-compat": "^4.0.0",
|
|
32
32
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
33
|
-
"eslint-plugin-functional": "^4.4.
|
|
33
|
+
"eslint-plugin-functional": "^4.4.1",
|
|
34
34
|
"eslint-plugin-import": "^2.22.1",
|
|
35
35
|
"eslint-plugin-jest": "^27.0.4",
|
|
36
36
|
"eslint-plugin-jest-dom": "^4.0.0",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"eslint-plugin-react": "^7.31.8",
|
|
41
41
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
42
42
|
"eslint-plugin-simple-import-sort": "^8.0.0",
|
|
43
|
-
"eslint-plugin-testing-library": "^5.7.0"
|
|
43
|
+
"eslint-plugin-testing-library": "^5.7.0",
|
|
44
|
+
"eslint-plugin-unicorn": "^42.0.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@types/confusing-browser-globals": "1.0.0",
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"publishConfig": {
|
|
57
58
|
"access": "public"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "728b8351b1895f7af4b9b476461f8a3fd6f34a60"
|
|
60
61
|
}
|
package/presets/base.js
CHANGED
|
@@ -64,6 +64,7 @@ module.exports = {
|
|
|
64
64
|
'eslint-plugin-import',
|
|
65
65
|
'eslint-plugin-jsdoc',
|
|
66
66
|
'eslint-plugin-prettier',
|
|
67
|
+
'eslint-plugin-unicorn',
|
|
67
68
|
],
|
|
68
69
|
env: {
|
|
69
70
|
// should align with parserOptions.ecmaVersion
|
|
@@ -126,6 +127,8 @@ module.exports = {
|
|
|
126
127
|
'jsdoc/valid-types': 'off',
|
|
127
128
|
// avoid assigning anonymous function to object key which is harder to trace when debug
|
|
128
129
|
'object-shorthand': ['error', 'always'],
|
|
130
|
+
// prefer Number static properties over global ones
|
|
131
|
+
'unicorn/prefer-number-properties': 'error',
|
|
129
132
|
},
|
|
130
133
|
overrides: [
|
|
131
134
|
{
|
|
@@ -272,8 +275,7 @@ module.exports = {
|
|
|
272
275
|
},
|
|
273
276
|
],
|
|
274
277
|
// forbid unnecessary callback wrapper
|
|
275
|
-
|
|
276
|
-
// 'functional/prefer-tacit': 'error',
|
|
278
|
+
'functional/prefer-tacit': 'error',
|
|
277
279
|
// @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
|
|
278
280
|
// 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
|
|
279
281
|
'no-undef': 'error',
|
package/presets/node.js
CHANGED
|
@@ -22,10 +22,20 @@ module.exports = {
|
|
|
22
22
|
'n/no-unpublished-bin': 'error',
|
|
23
23
|
// disallow unsupported Node.js built-in APIs on the specified version
|
|
24
24
|
'n/no-unsupported-features/node-builtins': 'error',
|
|
25
|
-
// prefer `import { Buffer } from 'node:buffer'`
|
|
25
|
+
// prefer `import { Buffer } from 'node:buffer'` as it is not isomorphic
|
|
26
26
|
'n/prefer-global/buffer': ['error', 'never'],
|
|
27
|
-
// prefer `
|
|
27
|
+
// prefer global `console` to be isomorphic
|
|
28
|
+
'n/prefer-global/console': ['error', 'always'],
|
|
29
|
+
// prefer `import process from 'node:process'` as it is not isomorphic
|
|
28
30
|
'n/prefer-global/process': ['error', 'never'],
|
|
31
|
+
// prefer global `TextDecoder` to be isomorphic
|
|
32
|
+
'n/prefer-global/text-decoder': ['error', 'always'],
|
|
33
|
+
// prefer global `TextEncoder` to be isomorphic
|
|
34
|
+
'n/prefer-global/text-encoder': ['error', 'always'],
|
|
35
|
+
// prefer global `URLSearchParams` to be isomorphic
|
|
36
|
+
'n/prefer-global/url-search-params': ['error', 'always'],
|
|
37
|
+
// prefer global `URL` to be isomorphic
|
|
38
|
+
'n/prefer-global/url': ['error', 'always'],
|
|
29
39
|
// make `process.exit()` expressions the same code path as `throw`
|
|
30
40
|
'n/process-exit-as-throw': 'error',
|
|
31
41
|
// enforce shebang on the entry bin file
|