Files
OCS_service/eslint.config.mjs
2026-05-23 14:51:37 +08:00

66 lines
1.4 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// @ts-check
import tsParser from '@typescript-eslint/parser'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
import vueParser from 'vue-eslint-parser'
import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt(
{
ignores: [
'**/app/components/ui/**',
],
},
// .ts/.tsx 文件直接使用 TypeScript parser
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
},
// .vue 文件:顶层用 vue-eslint-parser<script> 块内用 ts parser
{
files: ['**/*.vue'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
},
},
},
// import 自动排序
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},
{
files: ['**/type.ts', '**/types.ts', '**/*.d.ts'],
rules: {
'no-unused-vars': 'off',
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'vue/html-self-closing': ['error', { html: { void: 'any' } }],
'no-unused-vars': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
"@typescript-eslint/no-extraneous-class": "off",
},
},
)