@foray1010/eslint-config 10.1.0 → 10.2.1
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 +20 -0
- package/bases/base.mjs +13 -1
- package/bases/node.mjs +12 -0
- package/bases/react.mjs +2 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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
|
+
## [10.2.1](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@10.2.0...@foray1010/eslint-config@10.2.1) (2023-03-29)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** disable react/jsx-no-leaked-render as it does not recognize boolean type ([995d096](https://github.com/foray1010/common-presets/commit/995d096efa3627e46b48133ef9994fb4883a64c7))
|
|
11
|
+
|
|
12
|
+
## [10.2.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@10.1.0...@foray1010/eslint-config@10.2.0) (2023-03-29)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- enable @typescript-eslint/no-unused-vars ([ff31b94](https://github.com/foray1010/common-presets/commit/ff31b94884796f00723f396469d53ea747109ff9))
|
|
17
|
+
- **eslint-config:** enable n/no-process-exit ([9e9ddce](https://github.com/foray1010/common-presets/commit/9e9ddce3d43dad54fc9570e7f99bf7a6d3be009e))
|
|
18
|
+
- **eslint-config:** enable react/jsx-no-leaked-render ([d65d8b4](https://github.com/foray1010/common-presets/commit/d65d8b4a83c50b050ce2ab68701c691b9c885cbf))
|
|
19
|
+
- **eslint-config:** enable react/no-object-type-as-default-prop ([79c1639](https://github.com/foray1010/common-presets/commit/79c163963a3eaac503e79376ccf880b0165e6556))
|
|
20
|
+
- **eslint-config:** prefer inline exports ([2a9de59](https://github.com/foray1010/common-presets/commit/2a9de5940a042607bc9556989937647d98236f86))
|
|
21
|
+
|
|
22
|
+
### Reverts
|
|
23
|
+
|
|
24
|
+
- Revert "fix(eslint-config): disable n/prefer-global hacks as they do not work with flat config" ([1e02034](https://github.com/foray1010/common-presets/commit/1e02034f6a5ec5d7d19230ddebcbcbf64e682022))
|
|
25
|
+
|
|
6
26
|
## [10.1.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@10.0.5...@foray1010/eslint-config@10.1.0) (2023-03-27)
|
|
7
27
|
|
|
8
28
|
### Features
|
package/bases/base.mjs
CHANGED
|
@@ -79,7 +79,12 @@ async function generateTypeScriptConfig() {
|
|
|
79
79
|
},
|
|
80
80
|
],
|
|
81
81
|
// separate type exports which allow certain optimizations within compilers
|
|
82
|
-
'@typescript-eslint/consistent-type-exports':
|
|
82
|
+
'@typescript-eslint/consistent-type-exports': [
|
|
83
|
+
'error',
|
|
84
|
+
{
|
|
85
|
+
fixMixedExportsWithInlineTypeSpecifier: true,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
83
88
|
'@typescript-eslint/consistent-type-imports': [
|
|
84
89
|
'error',
|
|
85
90
|
{
|
|
@@ -124,6 +129,13 @@ async function generateTypeScriptConfig() {
|
|
|
124
129
|
],
|
|
125
130
|
// declaration merging between classes and interfaces is unsafe
|
|
126
131
|
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
132
|
+
'@typescript-eslint/no-unused-vars': [
|
|
133
|
+
'error',
|
|
134
|
+
{
|
|
135
|
+
// error is optional now
|
|
136
|
+
caughtErrors: 'all',
|
|
137
|
+
},
|
|
138
|
+
],
|
|
127
139
|
// do not block functions referring to other functions
|
|
128
140
|
'@typescript-eslint/no-use-before-define': [
|
|
129
141
|
'error',
|
package/bases/node.mjs
CHANGED
|
@@ -20,11 +20,23 @@ const nodeConfig = [
|
|
|
20
20
|
plugins: {
|
|
21
21
|
n: eslintPluginN,
|
|
22
22
|
},
|
|
23
|
+
languageOptions: {
|
|
24
|
+
globals: {
|
|
25
|
+
// hack to mute no-undef error, and show n/prefer-global/buffer error instead
|
|
26
|
+
// @ts-expect-error
|
|
27
|
+
Buffer: 'writable',
|
|
28
|
+
// hack to mute no-undef error, and show n/prefer-global/process error instead
|
|
29
|
+
// @ts-expect-error
|
|
30
|
+
process: 'writable',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
23
33
|
rules: {
|
|
24
34
|
// disallow deprecated node APIs
|
|
25
35
|
'n/no-deprecated-api': 'error',
|
|
26
36
|
// disallow the assignment to `exports`
|
|
27
37
|
'n/no-exports-assign': 'error',
|
|
38
|
+
// use process.exitCode instead
|
|
39
|
+
'n/no-process-exit': 'error',
|
|
28
40
|
// disallow `bin` files that npm ignores
|
|
29
41
|
'n/no-unpublished-bin': 'error',
|
|
30
42
|
// disallow unsupported Node.js built-in APIs on the specified version
|
package/bases/react.mjs
CHANGED
|
@@ -50,6 +50,8 @@ const reactConfig = [
|
|
|
50
50
|
shorthandLast: false,
|
|
51
51
|
},
|
|
52
52
|
],
|
|
53
|
+
// avoid unexpected react hook dead loops
|
|
54
|
+
'react/no-object-type-as-default-prop': 'error',
|
|
53
55
|
// rely on typescript instead, and it does not work well with types that are imported from elsewhere
|
|
54
56
|
'react/prop-types': 'off',
|
|
55
57
|
// avoid unnecessary closing tags
|
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": "10.1
|
|
4
|
+
"version": "10.2.1",
|
|
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": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@eslint-community/eslint-plugin-eslint-comments": "^3.2.1",
|
|
24
24
|
"@eslint/js": "^8.36.0",
|
|
25
|
-
"@foray1010/common-presets-utils": "^7.0.
|
|
25
|
+
"@foray1010/common-presets-utils": "^7.0.2",
|
|
26
26
|
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
|
27
27
|
"@typescript-eslint/parser": "^5.56.0",
|
|
28
28
|
"confusing-browser-globals": "^1.0.10",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "60e70bc680f7b1b43f4f45e4a7760306d1edc5ca"
|
|
68
68
|
}
|