@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 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.0";
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 vueRules = (isVue3 ? [
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
- ]).reduce((preRules, key) => {
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.rules
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.base.rules,
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderwyd/eslint-config",
3
3
  "type": "module",
4
- "version": "4.10.0",
4
+ "version": "4.10.1",
5
5
  "description": "Donny's ESLint config",
6
6
  "author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
7
7
  "license": "MIT",