Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
/* eslint-env node */
|
/* eslint-env node */
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
import globals from "globals";
|
import globals from "globals";
|
||||||
import pluginVue from "eslint-plugin-vue";
|
import pluginVue from "eslint-plugin-vue";
|
||||||
import parserVue from "vue-eslint-parser";
|
import parserVue from "vue-eslint-parser";
|
||||||
import importPlugin from "eslint-plugin-import";
|
import importPlugin, { createNodeResolver } from "eslint-plugin-import-x";
|
||||||
|
|
||||||
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
@@ -29,31 +33,31 @@ export default [
|
|||||||
},
|
},
|
||||||
|
|
||||||
plugins: {
|
plugins: {
|
||||||
import: importPlugin,
|
"import-x": importPlugin,
|
||||||
},
|
},
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
// 确保导入的模块实际存在(核心规则,防止构建失败)
|
// 确保导入的模块实际存在(核心规则,防止构建失败)
|
||||||
"import/no-unresolved": "error",
|
"import-x/no-unresolved": "error",
|
||||||
// 确保导入的命名导出实际存在
|
// 确保导入的命名导出实际存在
|
||||||
"import/named": "error",
|
"import-x/named": "error",
|
||||||
// 确保默认导出存在
|
// 确保默认导出存在
|
||||||
"import/default": "error",
|
"import-x/default": "error",
|
||||||
// 确保命名空间导出存在
|
// 确保命名空间导出存在
|
||||||
"import/namespace": "error",
|
"import-x/namespace": "error",
|
||||||
// Vue 相关规则
|
// Vue 相关规则
|
||||||
"vue/multi-word-component-names": "off",
|
"vue/multi-word-component-names": "off",
|
||||||
},
|
},
|
||||||
|
|
||||||
settings: {
|
settings: {
|
||||||
"import/resolver": {
|
"import-x/resolver-next": [
|
||||||
alias: {
|
createNodeResolver({
|
||||||
map: [
|
alias: {
|
||||||
["@", "./src"],
|
"@": [path.join(__dirname, "src")],
|
||||||
],
|
},
|
||||||
extensions: [".js", ".jsx", ".vue"],
|
extensions: [".mjs", ".cjs", ".js", ".jsx", ".vue", ".json", ".node"],
|
||||||
},
|
}),
|
||||||
},
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -75,8 +75,7 @@
|
|||||||
"@vitejs/plugin-vue": "^5.2.4",
|
"@vitejs/plugin-vue": "^5.2.4",
|
||||||
"@vue/test-utils": "^2.4.6",
|
"@vue/test-utils": "^2.4.6",
|
||||||
"eslint": "^10.4.1",
|
"eslint": "^10.4.1",
|
||||||
"eslint-import-resolver-alias": "^1.1.2",
|
"eslint-plugin-import-x": "^4.16.1",
|
||||||
"eslint-plugin-import": "^2.32.0",
|
|
||||||
"eslint-plugin-vue": "^10.9.1",
|
"eslint-plugin-vue": "^10.9.1",
|
||||||
"globals": "^17.5.0",
|
"globals": "^17.5.0",
|
||||||
"happy-dom": "^20.8.3",
|
"happy-dom": "^20.8.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user