@coderwyd/eslint-config 2.4.0 → 2.4.2
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 +11 -10
- package/dist/cli.js +11 -10
- package/dist/index.cjs +153 -80
- package/dist/index.d.cts +831 -860
- package/dist/index.d.ts +831 -860
- package/dist/index.js +153 -80
- package/package.json +25 -23
package/dist/index.js
CHANGED
|
@@ -41,7 +41,6 @@ async function comments() {
|
|
|
41
41
|
// src/constants/glob.ts
|
|
42
42
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
43
43
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
44
|
-
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
45
44
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
46
45
|
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
47
46
|
var GLOB_VUE = "**/*.vue";
|
|
@@ -449,8 +448,8 @@ var parserPlain = {
|
|
|
449
448
|
}
|
|
450
449
|
})
|
|
451
450
|
};
|
|
452
|
-
async function combine(...
|
|
453
|
-
const resolved = await Promise.all(
|
|
451
|
+
async function combine(...configs2) {
|
|
452
|
+
const resolved = await Promise.all(configs2);
|
|
454
453
|
return resolved.flat();
|
|
455
454
|
}
|
|
456
455
|
function renameRules(rules, map) {
|
|
@@ -464,8 +463,8 @@ function renameRules(rules, map) {
|
|
|
464
463
|
})
|
|
465
464
|
);
|
|
466
465
|
}
|
|
467
|
-
function renamePluginInConfigs(
|
|
468
|
-
return
|
|
466
|
+
function renamePluginInConfigs(configs2, map) {
|
|
467
|
+
return configs2.map((i) => {
|
|
469
468
|
const clone = { ...i };
|
|
470
469
|
if (clone.rules)
|
|
471
470
|
clone.rules = renameRules(clone.rules, map);
|
|
@@ -894,7 +893,7 @@ async function prettier(rules = {}) {
|
|
|
894
893
|
const pRules = {
|
|
895
894
|
...rules
|
|
896
895
|
};
|
|
897
|
-
const
|
|
896
|
+
const configs2 = [
|
|
898
897
|
{
|
|
899
898
|
name: "coderwyd/prettier/setup",
|
|
900
899
|
plugins: {
|
|
@@ -913,7 +912,7 @@ async function prettier(rules = {}) {
|
|
|
913
912
|
}
|
|
914
913
|
}
|
|
915
914
|
];
|
|
916
|
-
return
|
|
915
|
+
return configs2;
|
|
917
916
|
}
|
|
918
917
|
|
|
919
918
|
// src/configs/typescript.ts
|
|
@@ -1082,7 +1081,7 @@ async function unicorn() {
|
|
|
1082
1081
|
unicorn: default5
|
|
1083
1082
|
},
|
|
1084
1083
|
rules: {
|
|
1085
|
-
|
|
1084
|
+
// 'unicorn/better-regex': 'error',
|
|
1086
1085
|
"unicorn/catch-error-name": "error",
|
|
1087
1086
|
"unicorn/custom-error-definition": "error",
|
|
1088
1087
|
"unicorn/error-message": "error",
|
|
@@ -1136,7 +1135,7 @@ async function unicorn() {
|
|
|
1136
1135
|
"unicorn/prefer-prototype-methods": "error",
|
|
1137
1136
|
"unicorn/prefer-query-selector": "error",
|
|
1138
1137
|
"unicorn/prefer-reflect-apply": "error",
|
|
1139
|
-
|
|
1138
|
+
// 'unicorn/prefer-regexp-test': 'error',
|
|
1140
1139
|
"unicorn/prefer-string-replace-all": "error",
|
|
1141
1140
|
"unicorn/prefer-string-slice": "error",
|
|
1142
1141
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
@@ -1392,86 +1391,132 @@ async function perfectionist() {
|
|
|
1392
1391
|
// src/configs/react.ts
|
|
1393
1392
|
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
1394
1393
|
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
1394
|
+
var RemixPackages = [
|
|
1395
|
+
"@remix-run/node",
|
|
1396
|
+
"@remix-run/react",
|
|
1397
|
+
"@remix-run/serve",
|
|
1398
|
+
"@remix-run/dev"
|
|
1399
|
+
];
|
|
1400
|
+
var NextJsPackages = ["next"];
|
|
1395
1401
|
async function react(options = {}) {
|
|
1396
|
-
const {
|
|
1397
|
-
files = [GLOB_JSX, GLOB_TSX],
|
|
1398
|
-
overrides = {},
|
|
1399
|
-
typescript: typescript2 = true
|
|
1400
|
-
} = options;
|
|
1402
|
+
const { files = [GLOB_TS, GLOB_TSX], overrides = {} } = options;
|
|
1401
1403
|
await ensurePackages([
|
|
1402
|
-
"eslint-plugin
|
|
1404
|
+
"@eslint-react/eslint-plugin",
|
|
1403
1405
|
"eslint-plugin-react-hooks",
|
|
1404
1406
|
"eslint-plugin-react-refresh"
|
|
1405
1407
|
]);
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1408
|
+
const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
|
|
1409
|
+
const isTypeAware = !!tsconfigPath;
|
|
1410
|
+
const [pluginReact, pluginReactHooks, pluginReactRefresh, parserTs] = await Promise.all([
|
|
1411
|
+
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
1412
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
1413
|
+
interopDefault(import("eslint-plugin-react-refresh")),
|
|
1414
|
+
interopDefault(import("@typescript-eslint/parser"))
|
|
1415
|
+
]);
|
|
1413
1416
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
1414
1417
|
(i) => isPackageExists2(i)
|
|
1415
1418
|
);
|
|
1419
|
+
const isUsingRemix = RemixPackages.some((i) => isPackageExists2(i));
|
|
1420
|
+
const isUsingNext = NextJsPackages.some((i) => isPackageExists2(i));
|
|
1421
|
+
const plugins = pluginReact.configs.all.plugins;
|
|
1416
1422
|
return [
|
|
1417
1423
|
{
|
|
1418
1424
|
name: "coderwyd/react/setup",
|
|
1419
1425
|
plugins: {
|
|
1420
|
-
react:
|
|
1426
|
+
react: plugins["@eslint-react"],
|
|
1427
|
+
"react-dom": plugins["@eslint-react/dom"],
|
|
1421
1428
|
"react-hooks": pluginReactHooks,
|
|
1429
|
+
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1430
|
+
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1422
1431
|
"react-refresh": pluginReactRefresh
|
|
1423
|
-
},
|
|
1424
|
-
settings: {
|
|
1425
|
-
react: {
|
|
1426
|
-
version: "detect"
|
|
1427
|
-
}
|
|
1428
1432
|
}
|
|
1429
1433
|
},
|
|
1430
1434
|
{
|
|
1431
1435
|
files,
|
|
1432
1436
|
languageOptions: {
|
|
1437
|
+
parser: parserTs,
|
|
1433
1438
|
parserOptions: {
|
|
1434
1439
|
ecmaFeatures: {
|
|
1435
1440
|
jsx: true
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1441
|
+
},
|
|
1442
|
+
...isTypeAware ? { project: tsconfigPath } : {}
|
|
1443
|
+
},
|
|
1444
|
+
sourceType: "module"
|
|
1438
1445
|
},
|
|
1439
1446
|
name: "coderwyd/react/rules",
|
|
1440
1447
|
rules: {
|
|
1448
|
+
// recommended rules from @eslint-react/dom
|
|
1449
|
+
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
1450
|
+
"react-dom/no-dangerously-set-innerhtml": "warn",
|
|
1451
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
1452
|
+
"react-dom/no-find-dom-node": "error",
|
|
1453
|
+
"react-dom/no-missing-button-type": "warn",
|
|
1454
|
+
"react-dom/no-missing-iframe-sandbox": "warn",
|
|
1455
|
+
"react-dom/no-namespace": "error",
|
|
1456
|
+
"react-dom/no-render-return-value": "error",
|
|
1457
|
+
"react-dom/no-script-url": "warn",
|
|
1458
|
+
"react-dom/no-unsafe-iframe-sandbox": "warn",
|
|
1459
|
+
"react-dom/no-unsafe-target-blank": "warn",
|
|
1441
1460
|
// recommended rules react-hooks
|
|
1442
1461
|
"react-hooks/exhaustive-deps": "warn",
|
|
1443
1462
|
"react-hooks/rules-of-hooks": "error",
|
|
1444
1463
|
// react refresh
|
|
1445
1464
|
"react-refresh/only-export-components": [
|
|
1446
1465
|
"warn",
|
|
1447
|
-
{
|
|
1466
|
+
{
|
|
1467
|
+
allowConstantExport: isAllowConstantExport,
|
|
1468
|
+
allowExportNames: [
|
|
1469
|
+
...isUsingNext ? [
|
|
1470
|
+
"config",
|
|
1471
|
+
"generateStaticParams",
|
|
1472
|
+
"metadata",
|
|
1473
|
+
"generateMetadata",
|
|
1474
|
+
"viewport",
|
|
1475
|
+
"generateViewport"
|
|
1476
|
+
] : [],
|
|
1477
|
+
...isUsingRemix ? ["meta", "links", "headers", "loader", "action"] : []
|
|
1478
|
+
]
|
|
1479
|
+
}
|
|
1448
1480
|
],
|
|
1449
|
-
// recommended rules react
|
|
1450
|
-
"react/
|
|
1451
|
-
"react/
|
|
1452
|
-
"react/
|
|
1453
|
-
"react/
|
|
1454
|
-
"react/
|
|
1455
|
-
"react/
|
|
1456
|
-
"react/
|
|
1457
|
-
"react/
|
|
1458
|
-
"react/no-children-
|
|
1459
|
-
"react/no-
|
|
1460
|
-
"react/no-
|
|
1481
|
+
// recommended rules from @eslint-react
|
|
1482
|
+
"react/ensure-forward-ref-using-ref": "warn",
|
|
1483
|
+
"react/no-access-state-in-setstate": "error",
|
|
1484
|
+
"react/no-array-index-key": "warn",
|
|
1485
|
+
"react/no-children-count": "warn",
|
|
1486
|
+
"react/no-children-for-each": "warn",
|
|
1487
|
+
"react/no-children-map": "warn",
|
|
1488
|
+
"react/no-children-only": "warn",
|
|
1489
|
+
"react/no-children-prop": "warn",
|
|
1490
|
+
"react/no-children-to-array": "warn",
|
|
1491
|
+
"react/no-clone-element": "warn",
|
|
1492
|
+
"react/no-comment-textnodes": "warn",
|
|
1493
|
+
"react/no-component-will-mount": "error",
|
|
1494
|
+
"react/no-component-will-receive-props": "error",
|
|
1495
|
+
"react/no-component-will-update": "error",
|
|
1496
|
+
"react/no-create-ref": "error",
|
|
1461
1497
|
"react/no-direct-mutation-state": "error",
|
|
1462
|
-
"react/no-
|
|
1463
|
-
"react/no-
|
|
1464
|
-
"react/no-
|
|
1498
|
+
"react/no-duplicate-key": "error",
|
|
1499
|
+
"react/no-implicit-key": "error",
|
|
1500
|
+
"react/no-missing-key": "error",
|
|
1501
|
+
"react/no-nested-components": "warn",
|
|
1502
|
+
"react/no-redundant-should-component-update": "error",
|
|
1503
|
+
"react/no-set-state-in-component-did-mount": "warn",
|
|
1504
|
+
"react/no-set-state-in-component-did-update": "warn",
|
|
1505
|
+
"react/no-set-state-in-component-will-update": "warn",
|
|
1465
1506
|
"react/no-string-refs": "error",
|
|
1466
|
-
"react/no-
|
|
1467
|
-
"react/no-
|
|
1468
|
-
"react/no-unsafe": "
|
|
1469
|
-
"react/
|
|
1470
|
-
"react/
|
|
1471
|
-
"react/
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1507
|
+
"react/no-unsafe-component-will-mount": "warn",
|
|
1508
|
+
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1509
|
+
"react/no-unsafe-component-will-update": "warn",
|
|
1510
|
+
"react/no-unstable-context-value": "error",
|
|
1511
|
+
"react/no-unstable-default-props": "error",
|
|
1512
|
+
"react/no-unused-class-component-members": "warn",
|
|
1513
|
+
"react/no-unused-state": "warn",
|
|
1514
|
+
"react/no-useless-fragment": "warn",
|
|
1515
|
+
"react/prefer-destructuring-assignment": "warn",
|
|
1516
|
+
"react/prefer-shorthand-boolean": "warn",
|
|
1517
|
+
"react/prefer-shorthand-fragment": "warn",
|
|
1518
|
+
...isTypeAware ? {
|
|
1519
|
+
"react/no-leaked-conditional-rendering": "warn"
|
|
1475
1520
|
} : {},
|
|
1476
1521
|
// overrides
|
|
1477
1522
|
...overrides
|
|
@@ -1548,7 +1593,7 @@ async function formatter(options = {}, prettierRules2 = {}) {
|
|
|
1548
1593
|
};
|
|
1549
1594
|
return config;
|
|
1550
1595
|
}
|
|
1551
|
-
const
|
|
1596
|
+
const configs2 = [
|
|
1552
1597
|
{
|
|
1553
1598
|
name: "coderwyd/formatter/setup",
|
|
1554
1599
|
plugins: {
|
|
@@ -1558,34 +1603,34 @@ async function formatter(options = {}, prettierRules2 = {}) {
|
|
|
1558
1603
|
];
|
|
1559
1604
|
if (html) {
|
|
1560
1605
|
const htmlConfig = createPrettierFormatter([GLOB_HTML], "html");
|
|
1561
|
-
|
|
1606
|
+
configs2.push(htmlConfig);
|
|
1562
1607
|
}
|
|
1563
1608
|
if (css) {
|
|
1564
1609
|
const cssConfig = createPrettierFormatter([GLOB_CSS, GLOB_POSTCSS], "css");
|
|
1565
1610
|
const scssConfig = createPrettierFormatter([GLOB_SCSS], "scss");
|
|
1566
1611
|
const lessConfig = createPrettierFormatter([GLOB_LESS], "less");
|
|
1567
|
-
|
|
1612
|
+
configs2.push(cssConfig, scssConfig, lessConfig);
|
|
1568
1613
|
}
|
|
1569
1614
|
if (markdown) {
|
|
1570
1615
|
const markdownConfig = createPrettierFormatter([GLOB_MARKDOWN], "markdown");
|
|
1571
|
-
|
|
1616
|
+
configs2.push(markdownConfig);
|
|
1572
1617
|
}
|
|
1573
1618
|
if (graphql) {
|
|
1574
1619
|
const graphqlConfig = createPrettierFormatter([GLOB_GRAPHQL], "graphql");
|
|
1575
|
-
|
|
1620
|
+
configs2.push(graphqlConfig);
|
|
1576
1621
|
}
|
|
1577
1622
|
if (yaml) {
|
|
1578
1623
|
const yamlConfig = createPrettierFormatter([GLOB_YAML], "yaml");
|
|
1579
|
-
|
|
1624
|
+
configs2.push(yamlConfig);
|
|
1580
1625
|
}
|
|
1581
1626
|
if (toml) {
|
|
1582
1627
|
await ensurePackages(["@toml-tools/parser", "prettier-plugin-toml"]);
|
|
1583
1628
|
const tomlConfig = createPrettierFormatter([GLOB_TOML], "toml", [
|
|
1584
1629
|
"prettier-plugin-toml"
|
|
1585
1630
|
]);
|
|
1586
|
-
|
|
1631
|
+
configs2.push(tomlConfig);
|
|
1587
1632
|
}
|
|
1588
|
-
return
|
|
1633
|
+
return configs2;
|
|
1589
1634
|
}
|
|
1590
1635
|
|
|
1591
1636
|
// src/configs/svelte.ts
|
|
@@ -1720,6 +1765,31 @@ async function command() {
|
|
|
1720
1765
|
];
|
|
1721
1766
|
}
|
|
1722
1767
|
|
|
1768
|
+
// src/configs/regexp.ts
|
|
1769
|
+
import { configs } from "eslint-plugin-regexp";
|
|
1770
|
+
async function regexp(options = {}) {
|
|
1771
|
+
const config = configs["flat/recommended"];
|
|
1772
|
+
const rules = {
|
|
1773
|
+
...config.rules
|
|
1774
|
+
};
|
|
1775
|
+
if (options.level === "warn") {
|
|
1776
|
+
Object.keys(rules).forEach((key) => {
|
|
1777
|
+
if (rules[key] === "error")
|
|
1778
|
+
rules[key] = "warn";
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
return [
|
|
1782
|
+
{
|
|
1783
|
+
...config,
|
|
1784
|
+
name: "coderwyd/regexp/rules",
|
|
1785
|
+
rules: {
|
|
1786
|
+
...rules,
|
|
1787
|
+
...options.overrides
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
];
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1723
1793
|
// src/env.ts
|
|
1724
1794
|
import process3 from "node:process";
|
|
1725
1795
|
import { isPackageExists as isPackageExists3 } from "local-pkg";
|
|
@@ -1759,6 +1829,7 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1759
1829
|
gitignore: enableGitignore = true,
|
|
1760
1830
|
isInEditor: isInEditor2 = isInEditor,
|
|
1761
1831
|
react: enableReact = false,
|
|
1832
|
+
regexp: enableRegexp = true,
|
|
1762
1833
|
svelte: enableSvelte = false,
|
|
1763
1834
|
tailwindcss: enableTailwindCSS = hasTailwindCSS,
|
|
1764
1835
|
typescript: enableTypeScript = hasTypeScript,
|
|
@@ -1766,24 +1837,24 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1766
1837
|
usePrettierrc = true,
|
|
1767
1838
|
vue: enableVue = hasVue
|
|
1768
1839
|
} = options;
|
|
1769
|
-
const
|
|
1840
|
+
const configs2 = [];
|
|
1770
1841
|
if (enableGitignore) {
|
|
1771
1842
|
if (typeof enableGitignore !== "boolean") {
|
|
1772
|
-
|
|
1843
|
+
configs2.push(
|
|
1773
1844
|
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
|
|
1774
1845
|
r(enableGitignore)
|
|
1775
1846
|
])
|
|
1776
1847
|
);
|
|
1777
1848
|
} else {
|
|
1778
1849
|
if (fs.existsSync(".gitignore"))
|
|
1779
|
-
|
|
1850
|
+
configs2.push(
|
|
1780
1851
|
interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
|
|
1781
1852
|
r()
|
|
1782
1853
|
])
|
|
1783
1854
|
);
|
|
1784
1855
|
}
|
|
1785
1856
|
}
|
|
1786
|
-
|
|
1857
|
+
configs2.push(
|
|
1787
1858
|
ignores(),
|
|
1788
1859
|
javascript({
|
|
1789
1860
|
isInEditor: isInEditor2,
|
|
@@ -1801,7 +1872,7 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1801
1872
|
if (enableVue)
|
|
1802
1873
|
componentExts.push("vue");
|
|
1803
1874
|
if (enableTypeScript) {
|
|
1804
|
-
|
|
1875
|
+
configs2.push(
|
|
1805
1876
|
typescript({
|
|
1806
1877
|
...resolveSubOptions(options, "typescript"),
|
|
1807
1878
|
componentExts,
|
|
@@ -1809,8 +1880,10 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1809
1880
|
})
|
|
1810
1881
|
);
|
|
1811
1882
|
}
|
|
1883
|
+
if (enableRegexp)
|
|
1884
|
+
configs2.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
|
|
1812
1885
|
if (options.test ?? true) {
|
|
1813
|
-
|
|
1886
|
+
configs2.push(
|
|
1814
1887
|
test({
|
|
1815
1888
|
isInEditor: isInEditor2,
|
|
1816
1889
|
overrides: getOverrides(options, "test")
|
|
@@ -1818,7 +1891,7 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1818
1891
|
);
|
|
1819
1892
|
}
|
|
1820
1893
|
if (enableVue) {
|
|
1821
|
-
|
|
1894
|
+
configs2.push(
|
|
1822
1895
|
vue({
|
|
1823
1896
|
...resolveSubOptions(options, "vue"),
|
|
1824
1897
|
overrides: getOverrides(options, "typescript"),
|
|
@@ -1827,15 +1900,15 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1827
1900
|
);
|
|
1828
1901
|
}
|
|
1829
1902
|
if (enableReact) {
|
|
1830
|
-
|
|
1903
|
+
configs2.push(
|
|
1831
1904
|
react({
|
|
1832
1905
|
overrides: getOverrides(options, "react"),
|
|
1833
|
-
|
|
1906
|
+
tsconfigPath: getOverrides(options, "typescript").tsconfigPath
|
|
1834
1907
|
})
|
|
1835
1908
|
);
|
|
1836
1909
|
}
|
|
1837
1910
|
if (enableSvelte) {
|
|
1838
|
-
|
|
1911
|
+
configs2.push(
|
|
1839
1912
|
svelte({
|
|
1840
1913
|
overrides: getOverrides(options, "svelte"),
|
|
1841
1914
|
typescript: !!enableTypeScript
|
|
@@ -1843,7 +1916,7 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1843
1916
|
);
|
|
1844
1917
|
}
|
|
1845
1918
|
if (enableUnoCSS) {
|
|
1846
|
-
|
|
1919
|
+
configs2.push(
|
|
1847
1920
|
unocss({
|
|
1848
1921
|
...resolveSubOptions(options, "unocss"),
|
|
1849
1922
|
overrides: getOverrides(options, "unocss")
|
|
@@ -1851,7 +1924,7 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1851
1924
|
);
|
|
1852
1925
|
}
|
|
1853
1926
|
if (enableTailwindCSS) {
|
|
1854
|
-
|
|
1927
|
+
configs2.push(
|
|
1855
1928
|
tailwindcss({
|
|
1856
1929
|
...resolveSubOptions(options, "tailwindcss"),
|
|
1857
1930
|
overrides: getOverrides(options, "tailwindcss")
|
|
@@ -1859,7 +1932,7 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1859
1932
|
);
|
|
1860
1933
|
}
|
|
1861
1934
|
if (options.jsonc ?? true) {
|
|
1862
|
-
|
|
1935
|
+
configs2.push(
|
|
1863
1936
|
jsonc({
|
|
1864
1937
|
overrides: getOverrides(options, "jsonc")
|
|
1865
1938
|
}),
|
|
@@ -1880,12 +1953,12 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1880
1953
|
);
|
|
1881
1954
|
Object.assign(prettierRules2, prettierConfig);
|
|
1882
1955
|
}
|
|
1883
|
-
|
|
1956
|
+
configs2.push(
|
|
1884
1957
|
prettier(prettierRules2),
|
|
1885
1958
|
formatter(formatterOptions, prettierRules2)
|
|
1886
1959
|
);
|
|
1887
1960
|
} else {
|
|
1888
|
-
|
|
1961
|
+
configs2.push(prettier());
|
|
1889
1962
|
}
|
|
1890
1963
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
1891
1964
|
if (key in options)
|
|
@@ -1893,8 +1966,8 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1893
1966
|
return acc;
|
|
1894
1967
|
}, {});
|
|
1895
1968
|
if (Object.keys(fusedConfig).length > 0)
|
|
1896
|
-
|
|
1897
|
-
const merged = await combine(...
|
|
1969
|
+
configs2.push([fusedConfig]);
|
|
1970
|
+
const merged = await combine(...configs2, ...userConfigs);
|
|
1898
1971
|
if (autoRenamePlugins)
|
|
1899
1972
|
return renamePluginInConfigs(merged, defaultPluginRenaming);
|
|
1900
1973
|
return merged;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.2",
|
|
5
5
|
"description": "Donny's ESLint config",
|
|
6
6
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,22 +33,22 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
36
|
+
"node": ">=18.18.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
+
"@eslint-react/eslint-plugin": "^1.5.8",
|
|
39
40
|
"@unocss/eslint-plugin": ">=0.50.0",
|
|
40
|
-
"eslint": "
|
|
41
|
-
"eslint-plugin-react": "^7.33.2",
|
|
41
|
+
"eslint": "^8.56.0 || ^9.0.0",
|
|
42
42
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
43
43
|
"eslint-plugin-react-refresh": "^0.4.4",
|
|
44
44
|
"eslint-plugin-svelte": "^2.34.1",
|
|
45
45
|
"svelte-eslint-parser": "^0.33.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
|
-
"@
|
|
48
|
+
"@eslint-react/eslint-plugin": {
|
|
49
49
|
"optional": true
|
|
50
50
|
},
|
|
51
|
-
"eslint-plugin
|
|
51
|
+
"@unocss/eslint-plugin": {
|
|
52
52
|
"optional": true
|
|
53
53
|
},
|
|
54
54
|
"eslint-plugin-react-hooks": {
|
|
@@ -67,31 +67,32 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@antfu/install-pkg": "^0.3.3",
|
|
69
69
|
"@toml-tools/parser": "^1.0.0",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
71
|
-
"@typescript-eslint/parser": "^7.
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
|
71
|
+
"@typescript-eslint/parser": "^7.9.0",
|
|
72
72
|
"eslint-config-flat-gitignore": "^0.1.5",
|
|
73
73
|
"eslint-config-prettier": "^9.1.0",
|
|
74
74
|
"eslint-plugin-antfu": "^2.2.0",
|
|
75
|
-
"eslint-plugin-command": "^0.2.
|
|
75
|
+
"eslint-plugin-command": "^0.2.3",
|
|
76
76
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
77
77
|
"eslint-plugin-import-x": "^0.5.0",
|
|
78
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
78
|
+
"eslint-plugin-jsdoc": "^48.2.5",
|
|
79
79
|
"eslint-plugin-jsonc": "^2.15.1",
|
|
80
|
-
"eslint-plugin-n": "^17.
|
|
80
|
+
"eslint-plugin-n": "^17.7.0",
|
|
81
81
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
82
82
|
"eslint-plugin-perfectionist": "^2.10.0",
|
|
83
83
|
"eslint-plugin-prettier": "^5.1.3",
|
|
84
|
-
"eslint-plugin-
|
|
85
|
-
"eslint-plugin-
|
|
84
|
+
"eslint-plugin-regexp": "^2.5.0",
|
|
85
|
+
"eslint-plugin-tailwindcss": "^3.15.2",
|
|
86
|
+
"eslint-plugin-unicorn": "^53.0.0",
|
|
86
87
|
"eslint-plugin-unused-imports": "^3.2.0",
|
|
87
88
|
"eslint-plugin-vitest": "^0.5.4",
|
|
88
89
|
"eslint-plugin-vue": "^9.26.0",
|
|
89
90
|
"eslint-typegen": "^0.2.4",
|
|
90
|
-
"globals": "^15.
|
|
91
|
+
"globals": "^15.3.0",
|
|
91
92
|
"jsonc-eslint-parser": "^2.4.0",
|
|
92
93
|
"local-pkg": "^0.5.0",
|
|
93
94
|
"parse-gitignore": "^2.0.0",
|
|
94
|
-
"picocolors": "^1.0.
|
|
95
|
+
"picocolors": "^1.0.1",
|
|
95
96
|
"prettier": "^3.2.5",
|
|
96
97
|
"prettier-plugin-toml": "^2.0.1",
|
|
97
98
|
"prompts": "^2.4.2",
|
|
@@ -100,29 +101,30 @@
|
|
|
100
101
|
},
|
|
101
102
|
"devDependencies": {
|
|
102
103
|
"@antfu/ni": "^0.21.12",
|
|
104
|
+
"@eslint-react/eslint-plugin": "^1.5.12",
|
|
103
105
|
"@eslint/config-inspector": "^0.4.8",
|
|
104
106
|
"@types/eslint": "^8.56.10",
|
|
105
107
|
"@types/fs-extra": "^11.0.4",
|
|
106
|
-
"@types/node": "^20.12.
|
|
108
|
+
"@types/node": "^20.12.12",
|
|
107
109
|
"@types/prompts": "^2.4.9",
|
|
108
110
|
"@types/yargs": "^17.0.32",
|
|
109
|
-
"@unocss/eslint-plugin": "^0.60.
|
|
111
|
+
"@unocss/eslint-plugin": "^0.60.2",
|
|
110
112
|
"bumpp": "^9.4.1",
|
|
111
|
-
"eslint": "9.
|
|
113
|
+
"eslint": "^9.3.0",
|
|
112
114
|
"eslint-plugin-react": "^7.34.1",
|
|
113
115
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
114
116
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
115
|
-
"eslint-plugin-svelte": "2.
|
|
116
|
-
"execa": "^9.0
|
|
117
|
+
"eslint-plugin-svelte": "2.39.0",
|
|
118
|
+
"execa": "^9.1.0",
|
|
117
119
|
"fast-glob": "^3.3.2",
|
|
118
120
|
"fs-extra": "^11.2.0",
|
|
119
121
|
"lint-staged": "^15.2.2",
|
|
120
|
-
"rimraf": "^5.0.
|
|
122
|
+
"rimraf": "^5.0.7",
|
|
121
123
|
"simple-git-hooks": "^2.11.1",
|
|
122
|
-
"svelte": "^4.2.
|
|
124
|
+
"svelte": "^4.2.17",
|
|
123
125
|
"svelte-eslint-parser": "^0.36.0",
|
|
124
126
|
"tsup": "^8.0.2",
|
|
125
|
-
"tsx": "^4.
|
|
127
|
+
"tsx": "^4.10.5",
|
|
126
128
|
"typescript": "^5.4.5"
|
|
127
129
|
},
|
|
128
130
|
"simple-git-hooks": {
|