@dhzh/eslint-config 0.9.4 → 0.10.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/dist/cli.cjs +15 -15
- package/dist/cli.js +15 -15
- package/dist/index.cjs +19 -13
- package/dist/index.d.cts +135 -787
- package/dist/index.d.ts +135 -787
- package/dist/index.js +19 -13
- package/package.json +14 -14
package/dist/cli.cjs
CHANGED
|
@@ -48,8 +48,8 @@ var import_picocolors = __toESM(require("picocolors"), 1);
|
|
|
48
48
|
var package_default = {
|
|
49
49
|
name: "@dhzh/eslint-config",
|
|
50
50
|
type: "module",
|
|
51
|
-
version: "0.
|
|
52
|
-
packageManager: "pnpm@9.
|
|
51
|
+
version: "0.10.0",
|
|
52
|
+
packageManager: "pnpm@9.5.0",
|
|
53
53
|
description: "Easton's ESLint config",
|
|
54
54
|
author: "Easton Zheng <dhzhme@gmail.com>",
|
|
55
55
|
license: "MIT",
|
|
@@ -133,29 +133,29 @@ var package_default = {
|
|
|
133
133
|
dependencies: {
|
|
134
134
|
"@antfu/install-pkg": "^0.3.3",
|
|
135
135
|
"@clack/prompts": "^0.7.0",
|
|
136
|
-
"@eslint-react/eslint-plugin": "^1.5.
|
|
137
|
-
"@stylistic/eslint-plugin": "^2.
|
|
138
|
-
"@typescript-eslint/eslint-plugin": "
|
|
139
|
-
"@typescript-eslint/parser": "
|
|
140
|
-
"eslint-config-flat-gitignore": "^0.1.
|
|
136
|
+
"@eslint-react/eslint-plugin": "^1.5.23",
|
|
137
|
+
"@stylistic/eslint-plugin": "^2.6.0-beta.0",
|
|
138
|
+
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
|
|
139
|
+
"@typescript-eslint/parser": "8.0.0-alpha.40",
|
|
140
|
+
"eslint-config-flat-gitignore": "^0.1.7",
|
|
141
141
|
"eslint-flat-config-utils": "^0.2.5",
|
|
142
142
|
"eslint-merge-processors": "^0.1.0",
|
|
143
143
|
"eslint-plugin-antfu": "^2.3.4",
|
|
144
144
|
"eslint-plugin-command": "^0.2.3",
|
|
145
145
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
146
146
|
"eslint-plugin-import-x": "^0.5.3",
|
|
147
|
-
"eslint-plugin-jsdoc": "^48.
|
|
147
|
+
"eslint-plugin-jsdoc": "^48.6.0",
|
|
148
148
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
149
149
|
"eslint-plugin-markdown": "^5.0.0",
|
|
150
150
|
"eslint-plugin-n": "^17.9.0",
|
|
151
151
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
152
152
|
"eslint-plugin-perfectionist": "^2.11.0",
|
|
153
153
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
154
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
154
|
+
"eslint-plugin-react-refresh": "^0.4.8",
|
|
155
155
|
"eslint-plugin-regexp": "^2.6.0",
|
|
156
156
|
"eslint-plugin-toml": "^0.11.1",
|
|
157
157
|
"eslint-plugin-unicorn": "^54.0.0",
|
|
158
|
-
"eslint-plugin-unused-imports": "^
|
|
158
|
+
"eslint-plugin-unused-imports": "^4.0.0",
|
|
159
159
|
"eslint-plugin-vitest": "^0.5.4",
|
|
160
160
|
"eslint-plugin-vue": "^9.27.0",
|
|
161
161
|
"eslint-plugin-yml": "^1.14.0",
|
|
@@ -181,12 +181,12 @@ var package_default = {
|
|
|
181
181
|
"@types/node": "^20.14.10",
|
|
182
182
|
"@types/prompts": "^2.4.9",
|
|
183
183
|
"@types/yargs": "^17.0.32",
|
|
184
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
184
|
+
"@unocss/eslint-plugin": "^0.61.3",
|
|
185
185
|
"astro-eslint-parser": "^1.0.2",
|
|
186
186
|
bumpp: "^9.4.1",
|
|
187
187
|
"bundle-require": "^5.0.0",
|
|
188
188
|
eslint: "npm:eslint-ts-patch@9.5.0-0",
|
|
189
|
-
"eslint-plugin-astro": "^1.2.
|
|
189
|
+
"eslint-plugin-astro": "^1.2.3",
|
|
190
190
|
"eslint-plugin-format": "^0.1.2",
|
|
191
191
|
"eslint-plugin-solid": "^0.14.1",
|
|
192
192
|
"eslint-plugin-svelte": "^2.41.0",
|
|
@@ -199,14 +199,14 @@ var package_default = {
|
|
|
199
199
|
"lint-staged": "^15.2.7",
|
|
200
200
|
"prettier-plugin-astro": "^0.14.0",
|
|
201
201
|
"prettier-plugin-slidev": "^1.0.5",
|
|
202
|
-
rimraf: "^
|
|
202
|
+
rimraf: "^6.0.0",
|
|
203
203
|
"simple-git-hooks": "^2.11.1",
|
|
204
204
|
svelte: "^4.2.18",
|
|
205
205
|
"svelte-eslint-parser": "^0.39.2",
|
|
206
206
|
tsup: "^8.1.0",
|
|
207
207
|
tsx: "^4.16.2",
|
|
208
208
|
typescript: "^5.5.3",
|
|
209
|
-
vitest: "^
|
|
209
|
+
vitest: "^2.0.1",
|
|
210
210
|
vue: "^3.4.31"
|
|
211
211
|
},
|
|
212
212
|
resolutions: {
|
|
@@ -406,7 +406,7 @@ function isGitClean() {
|
|
|
406
406
|
try {
|
|
407
407
|
(0, import_node_child_process.execSync)("git diff-index --quiet HEAD --");
|
|
408
408
|
return true;
|
|
409
|
-
} catch
|
|
409
|
+
} catch {
|
|
410
410
|
return false;
|
|
411
411
|
}
|
|
412
412
|
}
|
package/dist/cli.js
CHANGED
|
@@ -19,8 +19,8 @@ import c from "picocolors";
|
|
|
19
19
|
var package_default = {
|
|
20
20
|
name: "@dhzh/eslint-config",
|
|
21
21
|
type: "module",
|
|
22
|
-
version: "0.
|
|
23
|
-
packageManager: "pnpm@9.
|
|
22
|
+
version: "0.10.0",
|
|
23
|
+
packageManager: "pnpm@9.5.0",
|
|
24
24
|
description: "Easton's ESLint config",
|
|
25
25
|
author: "Easton Zheng <dhzhme@gmail.com>",
|
|
26
26
|
license: "MIT",
|
|
@@ -104,29 +104,29 @@ var package_default = {
|
|
|
104
104
|
dependencies: {
|
|
105
105
|
"@antfu/install-pkg": "^0.3.3",
|
|
106
106
|
"@clack/prompts": "^0.7.0",
|
|
107
|
-
"@eslint-react/eslint-plugin": "^1.5.
|
|
108
|
-
"@stylistic/eslint-plugin": "^2.
|
|
109
|
-
"@typescript-eslint/eslint-plugin": "
|
|
110
|
-
"@typescript-eslint/parser": "
|
|
111
|
-
"eslint-config-flat-gitignore": "^0.1.
|
|
107
|
+
"@eslint-react/eslint-plugin": "^1.5.23",
|
|
108
|
+
"@stylistic/eslint-plugin": "^2.6.0-beta.0",
|
|
109
|
+
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
|
|
110
|
+
"@typescript-eslint/parser": "8.0.0-alpha.40",
|
|
111
|
+
"eslint-config-flat-gitignore": "^0.1.7",
|
|
112
112
|
"eslint-flat-config-utils": "^0.2.5",
|
|
113
113
|
"eslint-merge-processors": "^0.1.0",
|
|
114
114
|
"eslint-plugin-antfu": "^2.3.4",
|
|
115
115
|
"eslint-plugin-command": "^0.2.3",
|
|
116
116
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
117
117
|
"eslint-plugin-import-x": "^0.5.3",
|
|
118
|
-
"eslint-plugin-jsdoc": "^48.
|
|
118
|
+
"eslint-plugin-jsdoc": "^48.6.0",
|
|
119
119
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
120
120
|
"eslint-plugin-markdown": "^5.0.0",
|
|
121
121
|
"eslint-plugin-n": "^17.9.0",
|
|
122
122
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
123
123
|
"eslint-plugin-perfectionist": "^2.11.0",
|
|
124
124
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
125
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
125
|
+
"eslint-plugin-react-refresh": "^0.4.8",
|
|
126
126
|
"eslint-plugin-regexp": "^2.6.0",
|
|
127
127
|
"eslint-plugin-toml": "^0.11.1",
|
|
128
128
|
"eslint-plugin-unicorn": "^54.0.0",
|
|
129
|
-
"eslint-plugin-unused-imports": "^
|
|
129
|
+
"eslint-plugin-unused-imports": "^4.0.0",
|
|
130
130
|
"eslint-plugin-vitest": "^0.5.4",
|
|
131
131
|
"eslint-plugin-vue": "^9.27.0",
|
|
132
132
|
"eslint-plugin-yml": "^1.14.0",
|
|
@@ -152,12 +152,12 @@ var package_default = {
|
|
|
152
152
|
"@types/node": "^20.14.10",
|
|
153
153
|
"@types/prompts": "^2.4.9",
|
|
154
154
|
"@types/yargs": "^17.0.32",
|
|
155
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
155
|
+
"@unocss/eslint-plugin": "^0.61.3",
|
|
156
156
|
"astro-eslint-parser": "^1.0.2",
|
|
157
157
|
bumpp: "^9.4.1",
|
|
158
158
|
"bundle-require": "^5.0.0",
|
|
159
159
|
eslint: "npm:eslint-ts-patch@9.5.0-0",
|
|
160
|
-
"eslint-plugin-astro": "^1.2.
|
|
160
|
+
"eslint-plugin-astro": "^1.2.3",
|
|
161
161
|
"eslint-plugin-format": "^0.1.2",
|
|
162
162
|
"eslint-plugin-solid": "^0.14.1",
|
|
163
163
|
"eslint-plugin-svelte": "^2.41.0",
|
|
@@ -170,14 +170,14 @@ var package_default = {
|
|
|
170
170
|
"lint-staged": "^15.2.7",
|
|
171
171
|
"prettier-plugin-astro": "^0.14.0",
|
|
172
172
|
"prettier-plugin-slidev": "^1.0.5",
|
|
173
|
-
rimraf: "^
|
|
173
|
+
rimraf: "^6.0.0",
|
|
174
174
|
"simple-git-hooks": "^2.11.1",
|
|
175
175
|
svelte: "^4.2.18",
|
|
176
176
|
"svelte-eslint-parser": "^0.39.2",
|
|
177
177
|
tsup: "^8.1.0",
|
|
178
178
|
tsx: "^4.16.2",
|
|
179
179
|
typescript: "^5.5.3",
|
|
180
|
-
vitest: "^
|
|
180
|
+
vitest: "^2.0.1",
|
|
181
181
|
vue: "^3.4.31"
|
|
182
182
|
},
|
|
183
183
|
resolutions: {
|
|
@@ -377,7 +377,7 @@ function isGitClean() {
|
|
|
377
377
|
try {
|
|
378
378
|
execSync("git diff-index --quiet HEAD --");
|
|
379
379
|
return true;
|
|
380
|
-
} catch
|
|
380
|
+
} catch {
|
|
381
381
|
return false;
|
|
382
382
|
}
|
|
383
383
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -690,8 +690,6 @@ async function ignores() {
|
|
|
690
690
|
return [
|
|
691
691
|
{
|
|
692
692
|
ignores: GLOB_EXCLUDE
|
|
693
|
-
// Awaits https://github.com/humanwhocodes/config-array/pull/131
|
|
694
|
-
// name: 'antfu/ignores',
|
|
695
693
|
}
|
|
696
694
|
];
|
|
697
695
|
}
|
|
@@ -1099,7 +1097,7 @@ async function markdown(options = {}) {
|
|
|
1099
1097
|
const markdown2 = await interopDefault(import("eslint-plugin-markdown"));
|
|
1100
1098
|
return [
|
|
1101
1099
|
{
|
|
1102
|
-
name: "
|
|
1100
|
+
name: "dhzh/markdown/setup",
|
|
1103
1101
|
plugins: {
|
|
1104
1102
|
markdown: markdown2
|
|
1105
1103
|
}
|
|
@@ -1107,7 +1105,7 @@ async function markdown(options = {}) {
|
|
|
1107
1105
|
{
|
|
1108
1106
|
files,
|
|
1109
1107
|
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
1110
|
-
name: "
|
|
1108
|
+
name: "dhzh/markdown/processor",
|
|
1111
1109
|
// `eslint-plugin-markdown` only creates virtual files for code blocks,
|
|
1112
1110
|
// but not the markdown file itself. We use `eslint-merge-processors` to
|
|
1113
1111
|
// add a pass-through processor for the markdown file itself.
|
|
@@ -1121,7 +1119,7 @@ async function markdown(options = {}) {
|
|
|
1121
1119
|
languageOptions: {
|
|
1122
1120
|
parser: parserPlain
|
|
1123
1121
|
},
|
|
1124
|
-
name: "
|
|
1122
|
+
name: "dhzh/markdown/parser"
|
|
1125
1123
|
},
|
|
1126
1124
|
{
|
|
1127
1125
|
files: [
|
|
@@ -1135,7 +1133,7 @@ async function markdown(options = {}) {
|
|
|
1135
1133
|
}
|
|
1136
1134
|
}
|
|
1137
1135
|
},
|
|
1138
|
-
name: "
|
|
1136
|
+
name: "dhzh/markdown/disables",
|
|
1139
1137
|
rules: {
|
|
1140
1138
|
"import/newline-after-import": "off",
|
|
1141
1139
|
"no-alert": "off",
|
|
@@ -1154,6 +1152,7 @@ async function markdown(options = {}) {
|
|
|
1154
1152
|
"ts/no-namespace": "off",
|
|
1155
1153
|
"ts/no-redeclare": "off",
|
|
1156
1154
|
"ts/no-require-imports": "off",
|
|
1155
|
+
"ts/no-unused-expressions": "off",
|
|
1157
1156
|
"ts/no-unused-vars": "off",
|
|
1158
1157
|
"ts/no-use-before-define": "off",
|
|
1159
1158
|
"ts/no-var-requires": "off",
|
|
@@ -1681,7 +1680,7 @@ async function svelte(options = {}) {
|
|
|
1681
1680
|
]);
|
|
1682
1681
|
return [
|
|
1683
1682
|
{
|
|
1684
|
-
name: "
|
|
1683
|
+
name: "dhzh/svelte/setup",
|
|
1685
1684
|
plugins: {
|
|
1686
1685
|
svelte: pluginSvelte
|
|
1687
1686
|
}
|
|
@@ -1695,7 +1694,7 @@ async function svelte(options = {}) {
|
|
|
1695
1694
|
parser: options.typescript ? await interopDefault(import("@typescript-eslint/parser")) : null
|
|
1696
1695
|
}
|
|
1697
1696
|
},
|
|
1698
|
-
name: "
|
|
1697
|
+
name: "dhzh/svelte/rules",
|
|
1699
1698
|
processor: pluginSvelte.processors[".svelte"],
|
|
1700
1699
|
rules: {
|
|
1701
1700
|
"import/no-mutable-exports": "off",
|
|
@@ -1731,7 +1730,12 @@ async function svelte(options = {}) {
|
|
|
1731
1730
|
"svelte/valid-each-key": "error",
|
|
1732
1731
|
"unused-imports/no-unused-vars": [
|
|
1733
1732
|
"error",
|
|
1734
|
-
{
|
|
1733
|
+
{
|
|
1734
|
+
args: "after-used",
|
|
1735
|
+
argsIgnorePattern: "^_",
|
|
1736
|
+
vars: "all",
|
|
1737
|
+
varsIgnorePattern: "^(_|\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
1738
|
+
}
|
|
1735
1739
|
],
|
|
1736
1740
|
...stylistic2 ? {
|
|
1737
1741
|
"style/indent": "off",
|
|
@@ -1883,14 +1887,12 @@ async function typescript(options = {}) {
|
|
|
1883
1887
|
const typeAwareRules = {
|
|
1884
1888
|
"dot-notation": "off",
|
|
1885
1889
|
"no-implied-eval": "off",
|
|
1886
|
-
"no-throw-literal": "off",
|
|
1887
1890
|
"ts/await-thenable": "error",
|
|
1888
1891
|
"ts/dot-notation": ["error", { allowKeywords: true }],
|
|
1889
1892
|
"ts/no-floating-promises": "error",
|
|
1890
1893
|
"ts/no-for-in-array": "error",
|
|
1891
1894
|
"ts/no-implied-eval": "error",
|
|
1892
1895
|
"ts/no-misused-promises": "error",
|
|
1893
|
-
"ts/no-throw-literal": "error",
|
|
1894
1896
|
"ts/no-unnecessary-type-assertion": "error",
|
|
1895
1897
|
"ts/no-unsafe-argument": "error",
|
|
1896
1898
|
"ts/no-unsafe-assignment": "error",
|
|
@@ -1922,7 +1924,10 @@ async function typescript(options = {}) {
|
|
|
1922
1924
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
1923
1925
|
sourceType: "module",
|
|
1924
1926
|
...typeAware ? {
|
|
1925
|
-
|
|
1927
|
+
projectService: {
|
|
1928
|
+
allowDefaultProject: ["./*.js"],
|
|
1929
|
+
defaultProject: tsconfigPath
|
|
1930
|
+
},
|
|
1926
1931
|
tsconfigRootDir: import_node_process2.default.cwd()
|
|
1927
1932
|
} : {},
|
|
1928
1933
|
...parserOptions
|
|
@@ -1963,13 +1968,13 @@ async function typescript(options = {}) {
|
|
|
1963
1968
|
"no-use-before-define": "off",
|
|
1964
1969
|
"no-useless-constructor": "off",
|
|
1965
1970
|
"ts/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
|
|
1966
|
-
"ts/ban-types": ["error", { types: { Function: false } }],
|
|
1967
1971
|
"ts/consistent-type-definitions": ["error", "interface"],
|
|
1968
1972
|
"ts/consistent-type-imports": ["error", { disallowTypeAnnotations: false, prefer: "type-imports" }],
|
|
1969
1973
|
"ts/method-signature-style": ["error", "property"],
|
|
1970
1974
|
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
1971
1975
|
"ts/no-dupe-class-members": "error",
|
|
1972
1976
|
"ts/no-dynamic-delete": "off",
|
|
1977
|
+
"ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
1973
1978
|
"ts/no-explicit-any": "off",
|
|
1974
1979
|
"ts/no-extraneous-class": "off",
|
|
1975
1980
|
"ts/no-import-type-side-effects": "error",
|
|
@@ -1981,6 +1986,7 @@ async function typescript(options = {}) {
|
|
|
1981
1986
|
"ts/no-unused-vars": "off",
|
|
1982
1987
|
"ts/no-use-before-define": ["error", { classes: false, functions: false, variables: true }],
|
|
1983
1988
|
"ts/no-useless-constructor": "off",
|
|
1989
|
+
"ts/no-wrapper-object-types": "error",
|
|
1984
1990
|
"ts/prefer-ts-expect-error": "error",
|
|
1985
1991
|
"ts/triple-slash-reference": "off",
|
|
1986
1992
|
"ts/unified-signatures": "off",
|