44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
/**
|
|
* frontend/eslint.config.js
|
|
* 用途:前端 ESLint 配置。目前只挂管理端 Element 迁移规则,且严重级别为 off。
|
|
* 依赖:vue-eslint-parser、typescript-eslint、eslint-rules/no-legacy-admin-controls.js。
|
|
* 逻辑:npm run lint 会加载本文件,但不会因为历史原生控件失败。
|
|
* 启用步骤见 docs/ui/ELEMENT_MIGRATION.md §9。不要把 lint 接进 npm run build。
|
|
*/
|
|
import vueParser from 'vue-eslint-parser';
|
|
import tseslint from 'typescript-eslint';
|
|
import noLegacyAdminControls from './eslint-rules/no-legacy-admin-controls.js';
|
|
|
|
export default [
|
|
{
|
|
ignores: ['dist/**', 'node_modules/**', 'coverage/**'],
|
|
},
|
|
{
|
|
files: [
|
|
'src/features/admin/**/*.vue',
|
|
'src/features/kb/components/KbAdminPanel.vue',
|
|
'src/features/kb/components/KbGroupDrawer.vue',
|
|
],
|
|
languageOptions: {
|
|
parser: vueParser,
|
|
parserOptions: {
|
|
parser: tseslint.parser,
|
|
extraFileExtensions: ['.vue'],
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
},
|
|
},
|
|
plugins: {
|
|
hxops: {
|
|
rules: {
|
|
'no-legacy-admin-controls': noLegacyAdminControls,
|
|
},
|
|
},
|
|
},
|
|
rules: {
|
|
// 启用时改为 'error'。步骤见 docs/ui/ELEMENT_MIGRATION.md §9。
|
|
'hxops/no-legacy-admin-controls': 'off',
|
|
},
|
|
},
|
|
];
|