@coderwyd/eslint-config 4.2.2 → 4.4.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.js +14 -14
- package/dist/dist-DYrxmIwK.js +1887 -0
- package/dist/index.d.ts +8033 -10302
- package/dist/index.js +124 -135
- package/package.json +35 -34
- package/dist/chunk-D2IgMYys.js +0 -33
- package/dist/jiti-Cidv43TO.js +0 -45803
- package/dist/src-Bzhof6OA.js +0 -1045
package/dist/index.js
CHANGED
|
@@ -3,14 +3,13 @@ import createCommand from "eslint-plugin-command/config";
|
|
|
3
3
|
import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
4
4
|
import pluginAntfu from "eslint-plugin-antfu";
|
|
5
5
|
import pluginDeMorgan from "eslint-plugin-de-morgan";
|
|
6
|
-
import * as pluginImport from "eslint-plugin-import-x";
|
|
7
6
|
import pluginNode from "eslint-plugin-n";
|
|
8
7
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
9
8
|
import pluginUnicorn from "eslint-plugin-unicorn";
|
|
10
9
|
import pluginUnusedImports from "eslint-plugin-unused-imports";
|
|
11
|
-
import globals from "globals";
|
|
12
10
|
import { fileURLToPath } from "node:url";
|
|
13
11
|
import { getPackageInfoSync, isPackageExists } from "local-pkg";
|
|
12
|
+
import globals from "globals";
|
|
14
13
|
import prettierRules from "eslint-config-prettier";
|
|
15
14
|
import { configs } from "eslint-plugin-regexp";
|
|
16
15
|
|
|
@@ -116,9 +115,113 @@ function ignores(userIgnores = []) {
|
|
|
116
115
|
}];
|
|
117
116
|
}
|
|
118
117
|
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/shared/index.ts
|
|
120
|
+
const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
121
|
+
const isCwdInScope = isPackageExists("@coderwyd/eslint-config");
|
|
122
|
+
/**
|
|
123
|
+
* Combine array and non-array configs into a single array.
|
|
124
|
+
*/
|
|
125
|
+
async function combine(...configs$1) {
|
|
126
|
+
const resolved = await Promise.all(configs$1);
|
|
127
|
+
return resolved.flat();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Rename plugin prefixes in a rule object.
|
|
131
|
+
* Accepts a map of prefixes to rename.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* import { renameRules } from '@coderwyd/eslint-config'
|
|
136
|
+
*
|
|
137
|
+
* export default [{
|
|
138
|
+
* rules: renameRules(
|
|
139
|
+
* {
|
|
140
|
+
* '@typescript-eslint/indent': 'error'
|
|
141
|
+
* },
|
|
142
|
+
* { '@typescript-eslint': 'ts' }
|
|
143
|
+
* )
|
|
144
|
+
* }]
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
function renameRules(rules, map) {
|
|
148
|
+
return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
|
|
149
|
+
for (const [from, to] of Object.entries(map)) if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
|
|
150
|
+
return [key, value];
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Rename plugin names a flat configs array
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* import { renamePluginInConfigs } from '@antfu/eslint-config'
|
|
159
|
+
* import someConfigs from './some-configs'
|
|
160
|
+
*
|
|
161
|
+
* export default renamePluginInConfigs(someConfigs, {
|
|
162
|
+
* '@typescript-eslint': 'ts',
|
|
163
|
+
* 'import-x': 'import',
|
|
164
|
+
* })
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
function renamePluginInConfigs(configs$1, map) {
|
|
168
|
+
return configs$1.map((i) => {
|
|
169
|
+
const clone = { ...i };
|
|
170
|
+
if (clone.rules) clone.rules = renameRules(clone.rules, map);
|
|
171
|
+
if (clone.plugins) clone.plugins = Object.fromEntries(Object.entries(clone.plugins).map(([key, value]) => {
|
|
172
|
+
if (key in map) return [map[key], value];
|
|
173
|
+
return [key, value];
|
|
174
|
+
}));
|
|
175
|
+
return clone;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
function getVueVersion() {
|
|
179
|
+
const pkg = getPackageInfoSync("vue", { paths: [process.cwd()] });
|
|
180
|
+
if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) return +pkg.version[0];
|
|
181
|
+
return 3;
|
|
182
|
+
}
|
|
183
|
+
function toArray(value) {
|
|
184
|
+
return Array.isArray(value) ? value : [value];
|
|
185
|
+
}
|
|
186
|
+
async function interopDefault(m) {
|
|
187
|
+
const resolved = await m;
|
|
188
|
+
return resolved.default || resolved;
|
|
189
|
+
}
|
|
190
|
+
function isPackageInScope(name) {
|
|
191
|
+
return isPackageExists(name, { paths: [scopeUrl] });
|
|
192
|
+
}
|
|
193
|
+
async function ensurePackages(packages) {
|
|
194
|
+
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
|
|
195
|
+
const nonExistingPackages = packages.filter((i) => !isPackageInScope(i));
|
|
196
|
+
if (nonExistingPackages.length === 0) return;
|
|
197
|
+
const { default: prompts } = await import("prompts");
|
|
198
|
+
const { result } = await prompts([{
|
|
199
|
+
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`,
|
|
200
|
+
name: "result",
|
|
201
|
+
type: "confirm"
|
|
202
|
+
}]);
|
|
203
|
+
if (result) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
204
|
+
}
|
|
205
|
+
function resolveSubOptions(options, key) {
|
|
206
|
+
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
207
|
+
}
|
|
208
|
+
function getOverrides(options, key) {
|
|
209
|
+
const subOptions = resolveSubOptions(options, key);
|
|
210
|
+
return { ..."overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {} };
|
|
211
|
+
}
|
|
212
|
+
function isInEditorEnv() {
|
|
213
|
+
if (process.env.CI) return false;
|
|
214
|
+
if (isInGitHooksOrLintStaged()) return false;
|
|
215
|
+
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM || false);
|
|
216
|
+
}
|
|
217
|
+
function isInGitHooksOrLintStaged() {
|
|
218
|
+
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged") || process.env.npm_lifecycle_script?.startsWith("nano-staged") || false);
|
|
219
|
+
}
|
|
220
|
+
|
|
119
221
|
//#endregion
|
|
120
222
|
//#region src/configs/imports.ts
|
|
121
|
-
function imports() {
|
|
223
|
+
async function imports() {
|
|
224
|
+
const pluginImport = await interopDefault(import("./dist-DYrxmIwK.js"));
|
|
122
225
|
return [{
|
|
123
226
|
name: "coderwyd/imports/rules",
|
|
124
227
|
plugins: {
|
|
@@ -134,9 +237,7 @@ function imports() {
|
|
|
134
237
|
"import/newline-after-import": ["error", { count: 1 }],
|
|
135
238
|
"import/no-duplicates": "error",
|
|
136
239
|
"import/no-mutable-exports": "error",
|
|
137
|
-
"import/no-named-default": "error"
|
|
138
|
-
"import/no-self-import": "error",
|
|
139
|
-
"import/no-webpack-loader-syntax": "error"
|
|
240
|
+
"import/no-named-default": "error"
|
|
140
241
|
}
|
|
141
242
|
}];
|
|
142
243
|
}
|
|
@@ -365,109 +466,6 @@ function javascript(options = {}) {
|
|
|
365
466
|
}];
|
|
366
467
|
}
|
|
367
468
|
|
|
368
|
-
//#endregion
|
|
369
|
-
//#region src/shared/index.ts
|
|
370
|
-
const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
371
|
-
const isCwdInScope = isPackageExists("@coderwyd/eslint-config");
|
|
372
|
-
/**
|
|
373
|
-
* Combine array and non-array configs into a single array.
|
|
374
|
-
*/
|
|
375
|
-
async function combine(...configs$1) {
|
|
376
|
-
const resolved = await Promise.all(configs$1);
|
|
377
|
-
return resolved.flat();
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Rename plugin prefixes in a rule object.
|
|
381
|
-
* Accepts a map of prefixes to rename.
|
|
382
|
-
*
|
|
383
|
-
* @example
|
|
384
|
-
* ```ts
|
|
385
|
-
* import { renameRules } from '@coderwyd/eslint-config'
|
|
386
|
-
*
|
|
387
|
-
* export default [{
|
|
388
|
-
* rules: renameRules(
|
|
389
|
-
* {
|
|
390
|
-
* '@typescript-eslint/indent': 'error'
|
|
391
|
-
* },
|
|
392
|
-
* { '@typescript-eslint': 'ts' }
|
|
393
|
-
* )
|
|
394
|
-
* }]
|
|
395
|
-
* ```
|
|
396
|
-
*/
|
|
397
|
-
function renameRules(rules, map) {
|
|
398
|
-
return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
|
|
399
|
-
for (const [from, to] of Object.entries(map)) if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
|
|
400
|
-
return [key, value];
|
|
401
|
-
}));
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Rename plugin names a flat configs array
|
|
405
|
-
*
|
|
406
|
-
* @example
|
|
407
|
-
* ```ts
|
|
408
|
-
* import { renamePluginInConfigs } from '@antfu/eslint-config'
|
|
409
|
-
* import someConfigs from './some-configs'
|
|
410
|
-
*
|
|
411
|
-
* export default renamePluginInConfigs(someConfigs, {
|
|
412
|
-
* '@typescript-eslint': 'ts',
|
|
413
|
-
* 'import-x': 'import',
|
|
414
|
-
* })
|
|
415
|
-
* ```
|
|
416
|
-
*/
|
|
417
|
-
function renamePluginInConfigs(configs$1, map) {
|
|
418
|
-
return configs$1.map((i) => {
|
|
419
|
-
const clone = { ...i };
|
|
420
|
-
if (clone.rules) clone.rules = renameRules(clone.rules, map);
|
|
421
|
-
if (clone.plugins) clone.plugins = Object.fromEntries(Object.entries(clone.plugins).map(([key, value]) => {
|
|
422
|
-
if (key in map) return [map[key], value];
|
|
423
|
-
return [key, value];
|
|
424
|
-
}));
|
|
425
|
-
return clone;
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
function getVueVersion() {
|
|
429
|
-
const pkg = getPackageInfoSync("vue", { paths: [process.cwd()] });
|
|
430
|
-
if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) return +pkg.version[0];
|
|
431
|
-
return 3;
|
|
432
|
-
}
|
|
433
|
-
function toArray(value) {
|
|
434
|
-
return Array.isArray(value) ? value : [value];
|
|
435
|
-
}
|
|
436
|
-
async function interopDefault(m) {
|
|
437
|
-
const resolved = await m;
|
|
438
|
-
return resolved.default || resolved;
|
|
439
|
-
}
|
|
440
|
-
function isPackageInScope(name) {
|
|
441
|
-
return isPackageExists(name, { paths: [scopeUrl] });
|
|
442
|
-
}
|
|
443
|
-
async function ensurePackages(packages) {
|
|
444
|
-
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
|
|
445
|
-
const nonExistingPackages = packages.filter((i) => !isPackageInScope(i));
|
|
446
|
-
if (nonExistingPackages.length === 0) return;
|
|
447
|
-
const { default: prompts } = await import("prompts");
|
|
448
|
-
const { result } = await prompts([{
|
|
449
|
-
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`,
|
|
450
|
-
name: "result",
|
|
451
|
-
type: "confirm"
|
|
452
|
-
}]);
|
|
453
|
-
if (result) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
454
|
-
}
|
|
455
|
-
function resolveSubOptions(options, key) {
|
|
456
|
-
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
457
|
-
}
|
|
458
|
-
function getOverrides(options, key) {
|
|
459
|
-
const subOptions = resolveSubOptions(options, key);
|
|
460
|
-
return { ..."overrides" in subOptions && subOptions.overrides ? subOptions.overrides : {} };
|
|
461
|
-
}
|
|
462
|
-
function isInEditorEnv() {
|
|
463
|
-
if (process.env.CI) return false;
|
|
464
|
-
if (isInGitHooksOrLintStaged()) return false;
|
|
465
|
-
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM || false);
|
|
466
|
-
}
|
|
467
|
-
function isInGitHooksOrLintStaged() {
|
|
468
|
-
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged") || process.env.npm_lifecycle_script?.startsWith("nano-staged") || false);
|
|
469
|
-
}
|
|
470
|
-
|
|
471
469
|
//#endregion
|
|
472
470
|
//#region src/configs/jsdoc.ts
|
|
473
471
|
async function jsdoc() {
|
|
@@ -677,11 +675,10 @@ async function react(options = {}) {
|
|
|
677
675
|
]);
|
|
678
676
|
const isTypeAware = !!tsconfigPath;
|
|
679
677
|
const typeAwareRules = { "react/no-leaked-conditional-rendering": "warn" };
|
|
680
|
-
const [pluginReact, pluginReactHooks, pluginReactRefresh
|
|
678
|
+
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
|
|
681
679
|
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
682
680
|
interopDefault(import("eslint-plugin-react-hooks")),
|
|
683
|
-
interopDefault(import("eslint-plugin-react-refresh"))
|
|
684
|
-
interopDefault(import("eslint-plugin-react-compiler"))
|
|
681
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
685
682
|
]);
|
|
686
683
|
const plugins = pluginReact.configs.all.plugins;
|
|
687
684
|
return [
|
|
@@ -689,7 +686,6 @@ async function react(options = {}) {
|
|
|
689
686
|
name: "coderwyd/react/setup",
|
|
690
687
|
plugins: {
|
|
691
688
|
react: plugins["@eslint-react"],
|
|
692
|
-
"react-compiler": pluginReactCompiler,
|
|
693
689
|
"react-dom": plugins["@eslint-react/dom"],
|
|
694
690
|
"react-hooks": pluginReactHooks,
|
|
695
691
|
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
@@ -706,7 +702,6 @@ async function react(options = {}) {
|
|
|
706
702
|
},
|
|
707
703
|
name: "coderwyd/react/rules",
|
|
708
704
|
rules: {
|
|
709
|
-
"react-compiler/react-compiler": "warn",
|
|
710
705
|
"react/no-access-state-in-setstate": "error",
|
|
711
706
|
"react/no-array-index-key": "warn",
|
|
712
707
|
"react/no-children-count": "warn",
|
|
@@ -762,6 +757,7 @@ async function react(options = {}) {
|
|
|
762
757
|
"react-dom/no-void-elements-with-children": "error",
|
|
763
758
|
"react-hooks/exhaustive-deps": "warn",
|
|
764
759
|
"react-hooks/rules-of-hooks": "error",
|
|
760
|
+
"react-hooks/react-compiler": "warn",
|
|
765
761
|
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
|
|
766
762
|
"react-hooks-extra/no-unnecessary-use-prefix": "warn",
|
|
767
763
|
"react-web-api/no-leaked-event-listener": "warn",
|
|
@@ -859,6 +855,7 @@ function sortPackageJson() {
|
|
|
859
855
|
"keywords",
|
|
860
856
|
"categories",
|
|
861
857
|
"sideEffects",
|
|
858
|
+
"imports",
|
|
862
859
|
"exports",
|
|
863
860
|
"main",
|
|
864
861
|
"module",
|
|
@@ -1354,7 +1351,8 @@ async function typescript(options = {}) {
|
|
|
1354
1351
|
|
|
1355
1352
|
//#endregion
|
|
1356
1353
|
//#region src/configs/unicorn.ts
|
|
1357
|
-
function unicorn() {
|
|
1354
|
+
function unicorn(options = {}) {
|
|
1355
|
+
const { overrides = {} } = options;
|
|
1358
1356
|
return [{
|
|
1359
1357
|
name: "coderwyd/unicorn/rules",
|
|
1360
1358
|
plugins: { unicorn: pluginUnicorn },
|
|
@@ -1367,21 +1365,22 @@ function unicorn() {
|
|
|
1367
1365
|
"unicorn/escape-case": "error",
|
|
1368
1366
|
"unicorn/new-for-builtins": "error",
|
|
1369
1367
|
"unicorn/no-array-method-this-argument": "error",
|
|
1370
|
-
"unicorn/no-array-push-push": "error",
|
|
1371
1368
|
"unicorn/no-await-in-promise-methods": "error",
|
|
1372
1369
|
"unicorn/no-console-spaces": "error",
|
|
1373
1370
|
"unicorn/no-for-loop": "error",
|
|
1374
1371
|
"unicorn/no-hex-escape": "error",
|
|
1375
1372
|
"unicorn/no-instanceof-builtins": "error",
|
|
1376
1373
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
1377
|
-
"unicorn/no-length-as-slice-end": "error",
|
|
1378
1374
|
"unicorn/no-lonely-if": "error",
|
|
1379
1375
|
"unicorn/no-negation-in-equality-check": "error",
|
|
1380
1376
|
"unicorn/no-new-array": "error",
|
|
1381
1377
|
"unicorn/no-new-buffer": "error",
|
|
1382
1378
|
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
1383
1379
|
"unicorn/no-static-only-class": "error",
|
|
1380
|
+
"unicorn/no-unnecessary-array-flat-depth": "error",
|
|
1381
|
+
"unicorn/no-unnecessary-array-splice-count": "error",
|
|
1384
1382
|
"unicorn/no-unnecessary-await": "error",
|
|
1383
|
+
"unicorn/no-unnecessary-slice-end": "error",
|
|
1385
1384
|
"unicorn/no-zero-fractions": "error",
|
|
1386
1385
|
"unicorn/prefer-add-event-listener": "error",
|
|
1387
1386
|
"unicorn/prefer-array-find": "error",
|
|
@@ -1408,12 +1407,14 @@ function unicorn() {
|
|
|
1408
1407
|
"unicorn/prefer-prototype-methods": "error",
|
|
1409
1408
|
"unicorn/prefer-query-selector": "error",
|
|
1410
1409
|
"unicorn/prefer-reflect-apply": "error",
|
|
1410
|
+
"unicorn/prefer-single-call": "error",
|
|
1411
1411
|
"unicorn/prefer-string-replace-all": "error",
|
|
1412
1412
|
"unicorn/prefer-string-slice": "error",
|
|
1413
1413
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1414
1414
|
"unicorn/prefer-string-trim-start-end": "error",
|
|
1415
1415
|
"unicorn/prefer-type-error": "error",
|
|
1416
|
-
"unicorn/throw-new-error": "error"
|
|
1416
|
+
"unicorn/throw-new-error": "error",
|
|
1417
|
+
...overrides
|
|
1417
1418
|
}
|
|
1418
1419
|
}];
|
|
1419
1420
|
}
|
|
@@ -1643,7 +1644,7 @@ const defaultPluginRenaming = {
|
|
|
1643
1644
|
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
1644
1645
|
"@eslint-react/naming-convention": "react-naming-convention",
|
|
1645
1646
|
"@typescript-eslint": "ts",
|
|
1646
|
-
"import-
|
|
1647
|
+
"import-lite": "import",
|
|
1647
1648
|
n: "node",
|
|
1648
1649
|
vitest: "test",
|
|
1649
1650
|
yml: "yaml"
|
|
@@ -1676,22 +1677,10 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1676
1677
|
})]));
|
|
1677
1678
|
const typescriptOptions = resolveSubOptions(options, "typescript");
|
|
1678
1679
|
const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
|
|
1679
|
-
configs$1.push(
|
|
1680
|
-
|
|
1681
|
-
javascript
|
|
1682
|
-
|
|
1683
|
-
overrides: getOverrides(options, "javascript")
|
|
1684
|
-
}),
|
|
1685
|
-
comments(),
|
|
1686
|
-
node(),
|
|
1687
|
-
jsdoc(),
|
|
1688
|
-
imports(),
|
|
1689
|
-
unicorn(),
|
|
1690
|
-
command(),
|
|
1691
|
-
deMorgan(),
|
|
1692
|
-
perfectionist()
|
|
1693
|
-
// Optional plugins (installed but not enabled by default)
|
|
1694
|
-
);
|
|
1680
|
+
configs$1.push(ignores(options.ignores), javascript({
|
|
1681
|
+
isInEditor: isInEditor$1,
|
|
1682
|
+
overrides: getOverrides(options, "javascript")
|
|
1683
|
+
}), comments(), node(), jsdoc(), imports(), unicorn(), command(), deMorgan(), perfectionist());
|
|
1695
1684
|
if (enableVue) componentExts.push("vue");
|
|
1696
1685
|
if (enableTypeScript) configs$1.push(typescript({
|
|
1697
1686
|
...typescriptOptions,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.4.0",
|
|
5
5
|
"description": "Donny's ESLint config",
|
|
6
6
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
|
-
".": "./dist/index.js"
|
|
20
|
+
".": "./dist/index.js",
|
|
21
|
+
"./cli": "./dist/cli.js",
|
|
22
|
+
"./package.json": "./package.json"
|
|
21
23
|
},
|
|
22
24
|
"main": "./dist/index.js",
|
|
25
|
+
"module": "./dist/index.js",
|
|
23
26
|
"types": "./dist/index.d.ts",
|
|
24
27
|
"bin": "./bin/index.js",
|
|
25
28
|
"files": [
|
|
@@ -33,7 +36,6 @@
|
|
|
33
36
|
"@eslint-react/eslint-plugin": "^1.5.8",
|
|
34
37
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
35
38
|
"eslint": "^9.5.0",
|
|
36
|
-
"eslint-plugin-react-compiler": "^19.0.0-beta-decd7b8-20250118",
|
|
37
39
|
"eslint-plugin-react-hooks": "^4.6.0 || ^5.0.0",
|
|
38
40
|
"eslint-plugin-react-refresh": "^0.4.4",
|
|
39
41
|
"eslint-plugin-svelte": ">=2.35.1",
|
|
@@ -67,30 +69,29 @@
|
|
|
67
69
|
}
|
|
68
70
|
},
|
|
69
71
|
"dependencies": {
|
|
70
|
-
"@antfu/install-pkg": "^1.
|
|
72
|
+
"@antfu/install-pkg": "^1.1.0",
|
|
71
73
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
73
|
-
"@typescript-eslint/parser": "^8.
|
|
74
|
-
"@vitest/eslint-plugin": "^1.
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^8.34.1",
|
|
75
|
+
"@typescript-eslint/parser": "^8.34.1",
|
|
76
|
+
"@vitest/eslint-plugin": "^1.2.7",
|
|
75
77
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
76
|
-
"eslint-config-prettier": "^10.1.
|
|
78
|
+
"eslint-config-prettier": "^10.1.5",
|
|
77
79
|
"eslint-plugin-antfu": "^3.1.1",
|
|
78
|
-
"eslint-plugin-command": "^3.2.
|
|
79
|
-
"eslint-plugin-de-morgan": "^1.
|
|
80
|
+
"eslint-plugin-command": "^3.2.1",
|
|
81
|
+
"eslint-plugin-de-morgan": "^1.3.0",
|
|
80
82
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
81
|
-
"eslint-plugin-
|
|
82
|
-
"eslint-plugin-
|
|
83
|
-
"eslint-plugin-
|
|
84
|
-
"eslint-plugin-n": "^17.17.0",
|
|
83
|
+
"eslint-plugin-jsdoc": "^51.0.3",
|
|
84
|
+
"eslint-plugin-jsonc": "^2.20.1",
|
|
85
|
+
"eslint-plugin-n": "^17.20.0",
|
|
85
86
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
86
|
-
"eslint-plugin-perfectionist": "^4.
|
|
87
|
-
"eslint-plugin-regexp": "^2.
|
|
88
|
-
"eslint-plugin-unicorn": "^
|
|
87
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
88
|
+
"eslint-plugin-regexp": "^2.9.0",
|
|
89
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
89
90
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
90
|
-
"eslint-plugin-vue": "^10.
|
|
91
|
+
"eslint-plugin-vue": "^10.2.0",
|
|
91
92
|
"eslint-plugin-yml": "^1.18.0",
|
|
92
|
-
"eslint-typegen": "^2.
|
|
93
|
-
"globals": "^16.
|
|
93
|
+
"eslint-typegen": "^2.2.0",
|
|
94
|
+
"globals": "^16.2.0",
|
|
94
95
|
"jsonc-eslint-parser": "^2.4.0",
|
|
95
96
|
"local-pkg": "^1.1.1",
|
|
96
97
|
"parse-gitignore": "^2.0.0",
|
|
@@ -99,30 +100,30 @@
|
|
|
99
100
|
"prompts": "^2.4.2",
|
|
100
101
|
"vue-eslint-parser": "^10.1.3",
|
|
101
102
|
"yaml-eslint-parser": "^1.3.0",
|
|
102
|
-
"yargs": "^
|
|
103
|
+
"yargs": "^18.0.0"
|
|
103
104
|
},
|
|
104
105
|
"devDependencies": {
|
|
105
|
-
"@antfu/ni": "^
|
|
106
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
107
|
-
"@eslint/config-inspector": "^1.0
|
|
106
|
+
"@antfu/ni": "^25.0.0",
|
|
107
|
+
"@eslint-react/eslint-plugin": "^1.52.2",
|
|
108
|
+
"@eslint/config-inspector": "^1.1.0",
|
|
108
109
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
109
|
-
"@types/node": "^
|
|
110
|
+
"@types/node": "^24.0.3",
|
|
110
111
|
"@types/prompts": "^2.4.9",
|
|
111
112
|
"@types/yargs": "^17.0.33",
|
|
112
|
-
"@unocss/eslint-plugin": "^66.
|
|
113
|
-
"bumpp": "^10.
|
|
114
|
-
"eslint": "^9.
|
|
115
|
-
"eslint-plugin-
|
|
116
|
-
"eslint-plugin-react-hooks": "
|
|
113
|
+
"@unocss/eslint-plugin": "^66.2.3",
|
|
114
|
+
"bumpp": "^10.2.0",
|
|
115
|
+
"eslint": "^9.29.0",
|
|
116
|
+
"eslint-plugin-import-lite": "^0.3.0",
|
|
117
|
+
"eslint-plugin-react-hooks": "6.0.0-rc.1",
|
|
117
118
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
118
|
-
"eslint-plugin-svelte": "^3.
|
|
119
|
+
"eslint-plugin-svelte": "^3.9.2",
|
|
119
120
|
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
120
121
|
"jiti": "^2.4.2",
|
|
121
122
|
"nano-staged": "^0.8.0",
|
|
122
123
|
"simple-git-hooks": "^2.13.0",
|
|
123
|
-
"svelte": "^5.
|
|
124
|
-
"svelte-eslint-parser": "^1.
|
|
125
|
-
"tsdown": "^0.
|
|
124
|
+
"svelte": "^5.34.6",
|
|
125
|
+
"svelte-eslint-parser": "^1.2.0",
|
|
126
|
+
"tsdown": "^0.12.8",
|
|
126
127
|
"typescript": "^5.8.3"
|
|
127
128
|
},
|
|
128
129
|
"simple-git-hooks": {
|
package/dist/chunk-D2IgMYys.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __esm = (fn, res) => function() {
|
|
11
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
12
|
-
};
|
|
13
|
-
var __commonJS = (cb, mod) => function() {
|
|
14
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
18
|
-
key = keys[i];
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
20
|
-
get: ((k) => from[k]).bind(null, key),
|
|
21
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
-
value: mod,
|
|
28
|
-
enumerable: true
|
|
29
|
-
}) : target, mod));
|
|
30
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
export { __commonJS, __esm, __require, __toESM };
|