@coderwyd/eslint-config 4.10.0 → 4.10.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/dist/cli.mjs +1 -1
- package/dist/index.mjs +18 -10
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import prompts from "prompts";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "4.10.
|
|
12
|
+
var version = "4.10.1";
|
|
13
13
|
var devDependencies = {
|
|
14
14
|
"@eslint-react/eslint-plugin": "catalog:peer",
|
|
15
15
|
"@eslint/config-inspector": "catalog:dev",
|
package/dist/index.mjs
CHANGED
|
@@ -1588,19 +1588,27 @@ async function vue(options = {}) {
|
|
|
1588
1588
|
const { files = [GLOB_VUE], overrides = {} } = options;
|
|
1589
1589
|
const [pluginVue, parserVue] = await Promise.all([interopDefault(import("eslint-plugin-vue")), interopDefault(import("vue-eslint-parser"))]);
|
|
1590
1590
|
const isVue3 = getVueVersion() === 3;
|
|
1591
|
-
const
|
|
1592
|
-
"essential",
|
|
1593
|
-
"strongly-recommended",
|
|
1594
|
-
"recommended"
|
|
1591
|
+
const configKeys = isVue3 ? [
|
|
1592
|
+
"flat/essential",
|
|
1593
|
+
"flat/strongly-recommended",
|
|
1594
|
+
"flat/recommended"
|
|
1595
1595
|
] : [
|
|
1596
|
-
"vue2-essential",
|
|
1597
|
-
"vue2-strongly-recommended",
|
|
1598
|
-
"vue2-recommended"
|
|
1599
|
-
]
|
|
1596
|
+
"flat/vue2-essential",
|
|
1597
|
+
"flat/vue2-strongly-recommended",
|
|
1598
|
+
"flat/vue2-recommended"
|
|
1599
|
+
];
|
|
1600
|
+
function extractRules(config) {
|
|
1601
|
+
if (Array.isArray(config)) return config.reduce((acc, c) => {
|
|
1602
|
+
if (c && c.rules) Object.assign(acc, c.rules);
|
|
1603
|
+
return acc;
|
|
1604
|
+
}, {});
|
|
1605
|
+
return config?.rules ?? {};
|
|
1606
|
+
}
|
|
1607
|
+
const vueRules = configKeys.reduce((preRules, key) => {
|
|
1600
1608
|
const config = pluginVue.configs[key];
|
|
1601
1609
|
return {
|
|
1602
1610
|
...preRules,
|
|
1603
|
-
...config
|
|
1611
|
+
...extractRules(config)
|
|
1604
1612
|
};
|
|
1605
1613
|
}, {});
|
|
1606
1614
|
return [{
|
|
@@ -1618,7 +1626,7 @@ async function vue(options = {}) {
|
|
|
1618
1626
|
plugins: { vue: pluginVue },
|
|
1619
1627
|
processor: pluginVue.processors[".vue"],
|
|
1620
1628
|
rules: {
|
|
1621
|
-
...pluginVue.configs
|
|
1629
|
+
...pluginVue.configs["flat/base"].rules,
|
|
1622
1630
|
...vueRules,
|
|
1623
1631
|
"antfu/no-top-level-await": "off",
|
|
1624
1632
|
"node/prefer-global/process": "off",
|
package/package.json
CHANGED