2026-04-28 15:47:32 +08:00
|
|
|
import { globalIgnores } from 'eslint/config'
|
|
|
|
|
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
|
|
|
|
import pluginVue from 'eslint-plugin-vue'
|
|
|
|
|
import pluginOxlint from 'eslint-plugin-oxlint'
|
|
|
|
|
|
|
|
|
|
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
|
|
|
|
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
|
|
|
|
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
|
|
|
|
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
|
|
|
|
|
|
|
|
|
export default defineConfigWithVueTs(
|
|
|
|
|
{
|
|
|
|
|
name: 'app/files-to-lint',
|
|
|
|
|
files: ['**/*.{vue,ts,mts,tsx}'],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
|
|
|
|
|
|
|
|
|
|
...pluginVue.configs['flat/essential'],
|
|
|
|
|
vueTsConfigs.recommended,
|
|
|
|
|
|
|
|
|
|
...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'),
|
2026-07-19 16:25:46 +08:00
|
|
|
|
|
|
|
|
// 该前端由旧前端迁移而来,不得已使用 any,因此关闭此规则
|
|
|
|
|
{
|
|
|
|
|
name: 'app/legacy-no-explicit-any',
|
|
|
|
|
rules: {
|
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// views/ 目录下为路由页面级组件,非通用组件,不会与 HTML 原生元素冲突,因此关闭多词组件名检查
|
|
|
|
|
{
|
|
|
|
|
name: 'app/views-single-word',
|
|
|
|
|
files: ['src/views/**/*.vue'],
|
|
|
|
|
rules: {
|
|
|
|
|
'vue/multi-word-component-names': 'off',
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-04-28 15:47:32 +08:00
|
|
|
)
|