26 lines
951 B
TypeScript
26 lines
951 B
TypeScript
import globals from 'globals'
|
|
import tseslint from 'typescript-eslint'
|
|
import pluginVue from 'eslint-plugin-vue'
|
|
import { defineConfig } from 'eslint/config'
|
|
|
|
export default defineConfig([
|
|
{ files: ['**/*.{js,mjs,cjs,ts,mts,cts,vue}'], languageOptions: { globals: globals.browser } },
|
|
tseslint.configs.recommended,
|
|
pluginVue.configs['flat/essential'],
|
|
{
|
|
files: ['**/*.vue'],
|
|
languageOptions: { parserOptions: { parser: tseslint.parser } },
|
|
rules: {
|
|
'vue/multi-word-component-names': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
// 关闭所有需要类型信息的规则
|
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
'@typescript-eslint/no-unsafe-call': 'off',
|
|
'@typescript-eslint/no-unsafe-return': 'off',
|
|
'@typescript-eslint/no-unsafe-argument': 'off'
|
|
}
|
|
}
|
|
])
|