@1stg/eslint-config 9.0.6 → 10.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 +18 -0
- package/_util.js +1 -1
- package/angular.js +1 -1
- package/base.js +21 -15
- package/loose.js +6 -6
- package/overrides.js +0 -5
- package/package.json +20 -16
- package/react.js +2 -1
- package/ts-base.js +4 -4
- package/vue.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#371](https://github.com/1stG/configs/pull/371) [`3cbd4b7`](https://github.com/1stG/configs/commit/3cbd4b734f2297e58f4f917165924a903100d655) Thanks [@JounQin](https://github.com/JounQin)! - feat!: migrate `eslint-plugin-unicorn` to `eslint-plugin-unicorn-x`
|
|
8
|
+
|
|
9
|
+
- [#372](https://github.com/1stG/configs/pull/372) [`f6e2755`](https://github.com/1stG/configs/commit/f6e27555b4ece8266418cfb371b0165b8749b42d) Thanks [@JounQin](https://github.com/JounQin)! - feat!: use `n.convertPath` setting for hashbang rule
|
|
10
|
+
|
|
11
|
+
## 9.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#370](https://github.com/1stG/configs/pull/370) [`85d8686`](https://github.com/1stG/configs/commit/85d86864da883b8ea445e238d3c2ecb0c164a31d) Thanks [@JounQin](https://github.com/JounQin)! - feat: add `eslint-plugin-react-refresh` support
|
|
16
|
+
|
|
17
|
+
- [#367](https://github.com/1stG/configs/pull/367) [`94685f7`](https://github.com/1stG/configs/commit/94685f7c7b276238d6fa176c838222ca6eafd01c) Thanks [@JounQin](https://github.com/JounQin)! - chore(eslint): bump `eslint-plugin-unicorn` to v59.0.1
|
|
18
|
+
|
|
19
|
+
- [#369](https://github.com/1stG/configs/pull/369) [`5e8ada3`](https://github.com/1stG/configs/commit/5e8ada3c85dd8e8697f1215484798ece33f01804) Thanks [@JounQin](https://github.com/JounQin)! - feat: migrate `project` to `projectService` for TypeScript
|
|
20
|
+
|
|
3
21
|
## 9.0.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/_util.js
CHANGED
|
@@ -25,7 +25,7 @@ if (isMonorepo()) {
|
|
|
25
25
|
return acc
|
|
26
26
|
}
|
|
27
27
|
const { name, peerDependencies = {}, dependencies = {} } = pkgJson
|
|
28
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
28
|
+
// eslint-disable-next-line unicorn-x/prefer-spread
|
|
29
29
|
return acc.concat(
|
|
30
30
|
name,
|
|
31
31
|
Object.keys(peerDependencies),
|
package/angular.js
CHANGED
package/base.js
CHANGED
|
@@ -11,7 +11,7 @@ import promise from 'eslint-plugin-promise'
|
|
|
11
11
|
import regexp from 'eslint-plugin-regexp'
|
|
12
12
|
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
|
13
13
|
import sonarjs from 'eslint-plugin-sonarjs'
|
|
14
|
-
import
|
|
14
|
+
import unicornX from 'eslint-plugin-unicorn-x'
|
|
15
15
|
import globals from 'globals'
|
|
16
16
|
import tseslint from 'typescript-eslint'
|
|
17
17
|
|
|
@@ -32,7 +32,7 @@ export const base = tseslint.config([
|
|
|
32
32
|
promise.configs['flat/recommended'],
|
|
33
33
|
regexp.configs['flat/recommended'],
|
|
34
34
|
sonarjs.configs.recommended,
|
|
35
|
-
|
|
35
|
+
unicornX.configs.recommended,
|
|
36
36
|
prettierExtends,
|
|
37
37
|
{
|
|
38
38
|
name: '@1stg/node',
|
|
@@ -52,7 +52,13 @@ export const base = tseslint.config([
|
|
|
52
52
|
'node_modules/@d-ts',
|
|
53
53
|
'node_modules/@types',
|
|
54
54
|
],
|
|
55
|
-
'import-x/resolver-next':
|
|
55
|
+
'import-x/resolver-next': createTypeScriptImportResolver(),
|
|
56
|
+
n: {
|
|
57
|
+
convertPath: {
|
|
58
|
+
'**/bin.ts': [String.raw`^(src/)?bin\.ts$`, 'lib/bin.js'],
|
|
59
|
+
'**/cli.ts': [String.raw`^(src/)?cli\.ts$`, 'lib/cli.js'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
56
62
|
},
|
|
57
63
|
languageOptions: {
|
|
58
64
|
sourceType: 'module',
|
|
@@ -116,9 +122,9 @@ export const base = tseslint.config([
|
|
|
116
122
|
},
|
|
117
123
|
],
|
|
118
124
|
'no-negated-condition': 2,
|
|
119
|
-
'no-process-exit': 0, // suspended by unicorn/no-process-exit
|
|
125
|
+
'no-process-exit': 0, // suspended by unicorn-x/no-process-exit
|
|
120
126
|
|
|
121
|
-
// The following rules are duplicate with `eslint-plugin-import`
|
|
127
|
+
// The following rules are duplicate with `eslint-plugin-import-x`
|
|
122
128
|
'n/no-extraneous-import': 0,
|
|
123
129
|
'n/no-extraneous-require': 0,
|
|
124
130
|
'n/no-missing-import': 0,
|
|
@@ -131,15 +137,15 @@ export const base = tseslint.config([
|
|
|
131
137
|
'prefer-const': [2, { destructuring: 'all' }],
|
|
132
138
|
'prefer-object-spread': 2,
|
|
133
139
|
'simple-import-sort/exports': 2,
|
|
134
|
-
'unicorn/catch-error-name': [
|
|
140
|
+
'unicorn-x/catch-error-name': [
|
|
135
141
|
2,
|
|
136
142
|
{
|
|
137
143
|
name: 'error',
|
|
138
144
|
ignore: ['^e(rr)?$'],
|
|
139
145
|
},
|
|
140
146
|
],
|
|
141
|
-
'unicorn/consistent-function-scoping': 0,
|
|
142
|
-
'unicorn/filename-case': [
|
|
147
|
+
'unicorn-x/consistent-function-scoping': 0,
|
|
148
|
+
'unicorn-x/filename-case': [
|
|
143
149
|
2,
|
|
144
150
|
{
|
|
145
151
|
cases: {
|
|
@@ -150,13 +156,13 @@ export const base = tseslint.config([
|
|
|
150
156
|
ignore: [/^[A-Z](([\dA-Z]+_)*[\dA-Z]+)?\.(mdx?|ya?ml)$/],
|
|
151
157
|
},
|
|
152
158
|
],
|
|
153
|
-
'unicorn/no-array-reduce': 0,
|
|
154
|
-
'unicorn/no-null': 0,
|
|
155
|
-
'unicorn/no-unreadable-array-destructuring': 0, // conflict with `no-unused-vars`
|
|
156
|
-
'unicorn/prefer-module': 0,
|
|
157
|
-
'unicorn/prefer-object-from-entries': 0,
|
|
158
|
-
'unicorn/prevent-abbreviations': 0,
|
|
159
|
-
'unicorn/prefer-export-from': [2, { ignoreUsedVariables: true }],
|
|
159
|
+
'unicorn-x/no-array-reduce': 0,
|
|
160
|
+
'unicorn-x/no-null': 0,
|
|
161
|
+
'unicorn-x/no-unreadable-array-destructuring': 0, // conflict with `no-unused-vars`
|
|
162
|
+
'unicorn-x/prefer-module': 0,
|
|
163
|
+
'unicorn-x/prefer-object-from-entries': 0,
|
|
164
|
+
'unicorn-x/prevent-abbreviations': 0,
|
|
165
|
+
'unicorn-x/prefer-export-from': [2, { ignoreUsedVariables: true }],
|
|
160
166
|
},
|
|
161
167
|
},
|
|
162
168
|
{
|
package/loose.js
CHANGED
|
@@ -28,12 +28,12 @@ export const loose = tseslint.config([
|
|
|
28
28
|
'no-negated-condition': 0, // not auto-fixable
|
|
29
29
|
'promise/always-return': 0,
|
|
30
30
|
'promise/catch-or-return': 0,
|
|
31
|
-
'unicorn/explicit-length-check': 0,
|
|
32
|
-
'unicorn/no-array-for-each': 0,
|
|
33
|
-
'unicorn/no-fn-reference-in-iterator': 0,
|
|
34
|
-
'unicorn/prefer-number-properties': 0,
|
|
35
|
-
'unicorn/prefer-prototype-methods': 0,
|
|
36
|
-
'unicorn/prefer-spread': 0,
|
|
31
|
+
'unicorn-x/explicit-length-check': 0,
|
|
32
|
+
'unicorn-x/no-array-for-each': 0,
|
|
33
|
+
'unicorn-x/no-fn-reference-in-iterator': 0,
|
|
34
|
+
'unicorn-x/prefer-number-properties': 0,
|
|
35
|
+
'unicorn-x/prefer-prototype-methods': 0,
|
|
36
|
+
'unicorn-x/prefer-spread': 0,
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
])
|
package/overrides.js
CHANGED
|
@@ -26,11 +26,6 @@ import { resolveSettings, tsBase } from './ts-base.js'
|
|
|
26
26
|
|
|
27
27
|
export const ts = tseslint.config(
|
|
28
28
|
tsBase,
|
|
29
|
-
{
|
|
30
|
-
name: '@1stg/cli',
|
|
31
|
-
files: ['**/{bin,cli}.ts'],
|
|
32
|
-
rules: { 'n/hashbang': 0 },
|
|
33
|
-
},
|
|
34
29
|
{
|
|
35
30
|
name: '@1stg/code-block',
|
|
36
31
|
files: ['**/*.{md,mdx}/**/*.{cts,mts,ts,tsx}'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1stg/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Personal but Shareable ESLint Configuration for all 1stG.me projects",
|
|
6
6
|
"repository": "git+https://github.com/1stG/configs.git",
|
|
@@ -25,11 +25,12 @@
|
|
|
25
25
|
"@babel/eslint-plugin": "^7.0.0",
|
|
26
26
|
"@eslint-react/eslint-plugin": "^1.0.0",
|
|
27
27
|
"@vitest/eslint-plugin": "^1.0.0",
|
|
28
|
-
"angular-eslint": "^19.0.0",
|
|
28
|
+
"angular-eslint": "^18.0.0 || ^19.0.0",
|
|
29
29
|
"angular-eslint-template-parser": "^0.1.0",
|
|
30
30
|
"eslint": ">=8.0.0",
|
|
31
31
|
"eslint-plugin-jest": "^28.0.0",
|
|
32
32
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
33
|
+
"eslint-plugin-react-refresh": "^0.4.0",
|
|
33
34
|
"eslint-plugin-vue": "^10.0.0"
|
|
34
35
|
},
|
|
35
36
|
"peerDependenciesMeta": {
|
|
@@ -57,6 +58,9 @@
|
|
|
57
58
|
"eslint-plugin-react-hooks": {
|
|
58
59
|
"optional": true
|
|
59
60
|
},
|
|
61
|
+
"eslint-plugin-react-refresh": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
60
64
|
"eslint-plugin-vue": {
|
|
61
65
|
"optional": true
|
|
62
66
|
}
|
|
@@ -64,29 +68,29 @@
|
|
|
64
68
|
"dependencies": {
|
|
65
69
|
"@1stg/config": "^1.0.5",
|
|
66
70
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
67
|
-
"@eslint/js": "^9.
|
|
71
|
+
"@eslint/js": "^9.27.0",
|
|
68
72
|
"@pkgr/utils": "^3.1.2",
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
70
|
-
"@typescript-eslint/parser": "^8.
|
|
71
|
-
"eslint-config-prettier": "^10.1.
|
|
72
|
-
"eslint-import-resolver-typescript": "^4.3.
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
74
|
+
"@typescript-eslint/parser": "^8.32.1",
|
|
75
|
+
"eslint-config-prettier": "^10.1.5",
|
|
76
|
+
"eslint-import-resolver-typescript": "^4.3.5",
|
|
73
77
|
"eslint-plugin-css": "^0.11.0",
|
|
74
|
-
"eslint-plugin-import-x": "^4.
|
|
75
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
76
|
-
"eslint-plugin-jsonc": "^2.20.
|
|
78
|
+
"eslint-plugin-import-x": "^4.12.2",
|
|
79
|
+
"eslint-plugin-jsdoc": "^50.6.17",
|
|
80
|
+
"eslint-plugin-jsonc": "^2.20.1",
|
|
77
81
|
"eslint-plugin-markup": "^1.0.1",
|
|
78
|
-
"eslint-plugin-mdx": "^3.4.
|
|
79
|
-
"eslint-plugin-n": "^17.
|
|
80
|
-
"eslint-plugin-prettier": "^5.
|
|
82
|
+
"eslint-plugin-mdx": "^3.4.2",
|
|
83
|
+
"eslint-plugin-n": "^17.18.0",
|
|
84
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
81
85
|
"eslint-plugin-promise": "^7.2.1",
|
|
82
86
|
"eslint-plugin-regexp": "^2.7.0",
|
|
83
87
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
84
88
|
"eslint-plugin-sonarjs": "^3.0.2",
|
|
85
89
|
"eslint-plugin-toml": "^0.12.0",
|
|
86
|
-
"eslint-plugin-unicorn": "^
|
|
90
|
+
"eslint-plugin-unicorn-x": "^1.0.7",
|
|
87
91
|
"eslint-plugin-yml": "^1.18.0",
|
|
88
|
-
"globals": "^16.
|
|
89
|
-
"typescript-eslint": "^8.
|
|
92
|
+
"globals": "^16.1.0",
|
|
93
|
+
"typescript-eslint": "^8.32.1"
|
|
90
94
|
},
|
|
91
95
|
"publishConfig": {
|
|
92
96
|
"access": "public"
|
package/react.js
CHANGED
|
@@ -17,12 +17,13 @@ export const reactJsx = tseslint.config({
|
|
|
17
17
|
})
|
|
18
18
|
|
|
19
19
|
const reactHooks_ = tryRequirePkg('eslint-plugin-react-hooks')
|
|
20
|
+
const reactRefresh = tryRequirePkg('eslint-plugin-react-refresh')
|
|
20
21
|
|
|
21
22
|
export const react = tseslint.config(
|
|
22
23
|
{
|
|
23
24
|
name: '@1stg/react',
|
|
24
25
|
files: ['**/*.{js,jsx,tsx}'],
|
|
25
|
-
extends: [reactJsx],
|
|
26
|
+
extends: [reactRefresh?.configs.recommended, reactJsx].filter(Boolean),
|
|
26
27
|
rules: {
|
|
27
28
|
'@eslint-react/avoid-shorthand-boolean': 2,
|
|
28
29
|
// '@eslint-react/naming-convention/handler-prop': [
|
package/ts-base.js
CHANGED
|
@@ -25,7 +25,7 @@ export const tsBase = tseslint.config({
|
|
|
25
25
|
files: ['**/*.{cts,mts,ts,tsx}'],
|
|
26
26
|
languageOptions: {
|
|
27
27
|
parserOptions: {
|
|
28
|
-
|
|
28
|
+
projectService: true,
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
extends: [
|
|
@@ -129,10 +129,10 @@ export const tsBase = tseslint.config({
|
|
|
129
129
|
'promise/always-return': 0,
|
|
130
130
|
'promise/catch-or-return': 0,
|
|
131
131
|
// ts itself has guaranteed it
|
|
132
|
-
'unicorn/no-array-callback-reference': 0,
|
|
132
|
+
'unicorn-x/no-array-callback-reference': 0,
|
|
133
133
|
// covered by @typescript-eslint/no-extraneous-class
|
|
134
|
-
'unicorn/no-static-only-class': 0,
|
|
134
|
+
'unicorn-x/no-static-only-class': 0,
|
|
135
135
|
// covered by @typescript-eslint/no-this-alias
|
|
136
|
-
'unicorn/no-this-assignment': 0,
|
|
136
|
+
'unicorn-x/no-this-assignment': 0,
|
|
137
137
|
},
|
|
138
138
|
})
|