- 修复 console.error 包装器: String() 包裹 + try-catch 防止浏览器原生格式化崩溃 - 修复 empienhanced/merge 模板中 && → && - 修复 bedAllocation: ChangeBedDialog 组件缺失导致 patchAttr 渲染崩溃 - 修复 inOut 组件: 添加隐式 any 类型注解, 修正 OptionItem 接口定义 - 新增 api.d.ts: api.js 的 TypeScript 类型声明
67 lines
1.7 KiB
JavaScript
Executable File
67 lines
1.7 KiB
JavaScript
Executable File
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import globals from "globals";
|
|
import pluginVue from "eslint-plugin-vue";
|
|
import parserVue from "vue-eslint-parser";
|
|
import parserTs from "@typescript-eslint/parser";
|
|
import importPlugin, { createNodeResolver } from "eslint-plugin-import-x";
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default [
|
|
{
|
|
name: "app/files-to-lint",
|
|
files: ["**/*.{js,mjs,jsx,vue}"],
|
|
},
|
|
|
|
{
|
|
name: "app/files-to-ignore",
|
|
ignores: ["**/dist/**", "**/node_modules/**", "**/help-center/**"],
|
|
},
|
|
|
|
...pluginVue.configs["flat/recommended"],
|
|
|
|
{
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
},
|
|
parser: parserVue,
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
parserOptions: {
|
|
parser: parserTs,
|
|
},
|
|
},
|
|
|
|
plugins: {
|
|
"import-x": importPlugin,
|
|
},
|
|
|
|
rules: {
|
|
// 确保导入的模块实际存在(核心规则,防止构建失败)
|
|
"import-x/no-unresolved": ["error", { ignore: ["^virtual:"] }],
|
|
// 确保导入的命名导出实际存在
|
|
"import-x/named": "error",
|
|
// 确保默认导出存在
|
|
"import-x/default": "error",
|
|
// 确保命名空间导出存在
|
|
"import-x/namespace": "error",
|
|
// Vue 相关规则
|
|
"vue/multi-word-component-names": "off",
|
|
},
|
|
|
|
settings: {
|
|
"import-x/resolver-next": [
|
|
createNodeResolver({
|
|
alias: {
|
|
"@": [path.join(__dirname, "src")],
|
|
},
|
|
extensions: [".mjs", ".cjs", ".js", ".jsx", ".vue", ".json", ".node"],
|
|
}),
|
|
],
|
|
},
|
|
},
|
|
];
|