@coderwyd/eslint-config 4.10.0 → 4.10.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.mjs +1 -1
- package/dist/index.mjs +41 -11
- 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.2";
|
|
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,22 +1588,49 @@ 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 [{
|
|
1615
|
+
languageOptions: { globals: {
|
|
1616
|
+
computed: "readonly",
|
|
1617
|
+
defineEmits: "readonly",
|
|
1618
|
+
defineExpose: "readonly",
|
|
1619
|
+
defineProps: "readonly",
|
|
1620
|
+
onMounted: "readonly",
|
|
1621
|
+
onUnmounted: "readonly",
|
|
1622
|
+
reactive: "readonly",
|
|
1623
|
+
ref: "readonly",
|
|
1624
|
+
shallowReactive: "readonly",
|
|
1625
|
+
shallowRef: "readonly",
|
|
1626
|
+
toRef: "readonly",
|
|
1627
|
+
toRefs: "readonly",
|
|
1628
|
+
watch: "readonly",
|
|
1629
|
+
watchEffect: "readonly"
|
|
1630
|
+
} },
|
|
1631
|
+
name: "coderwyd/vue/setup",
|
|
1632
|
+
plugins: { vue: pluginVue }
|
|
1633
|
+
}, {
|
|
1607
1634
|
files,
|
|
1608
1635
|
languageOptions: {
|
|
1609
1636
|
parser: parserVue,
|
|
@@ -1615,10 +1642,9 @@ async function vue(options = {}) {
|
|
|
1615
1642
|
}
|
|
1616
1643
|
},
|
|
1617
1644
|
name: "coderwyd/vue/rules",
|
|
1618
|
-
plugins: { vue: pluginVue },
|
|
1619
1645
|
processor: pluginVue.processors[".vue"],
|
|
1620
1646
|
rules: {
|
|
1621
|
-
...pluginVue.configs
|
|
1647
|
+
...pluginVue.configs["flat/base"].rules,
|
|
1622
1648
|
...vueRules,
|
|
1623
1649
|
"antfu/no-top-level-await": "off",
|
|
1624
1650
|
"node/prefer-global/process": "off",
|
|
@@ -1642,10 +1668,14 @@ async function vue(options = {}) {
|
|
|
1642
1668
|
"defineEmits",
|
|
1643
1669
|
"defineSlots"
|
|
1644
1670
|
] }],
|
|
1671
|
+
"vue/dot-location": ["error", "property"],
|
|
1672
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
1645
1673
|
"vue/eqeqeq": ["error", "smart"],
|
|
1674
|
+
"vue/html-quotes": ["error", "double"],
|
|
1646
1675
|
"vue/max-attributes-per-line": "off",
|
|
1647
1676
|
"vue/multi-word-component-names": "off",
|
|
1648
1677
|
"vue/no-constant-condition": "warn",
|
|
1678
|
+
"vue/no-dupe-keys": "off",
|
|
1649
1679
|
"vue/no-duplicate-attr-inheritance": "warn",
|
|
1650
1680
|
"vue/no-empty-pattern": "error",
|
|
1651
1681
|
"vue/no-extra-parens": ["error", "functions"],
|
package/package.json
CHANGED