34 lines
928 B
TypeScript
34 lines
928 B
TypeScript
import { globalIgnores } from 'eslint/config'
|
|
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
|
import pluginVue from 'eslint-plugin-vue'
|
|
import pluginVitest from '@vitest/eslint-plugin'
|
|
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
|
|
|
export default defineConfigWithVueTs(
|
|
{
|
|
name: 'app/files-to-lint',
|
|
files: ['**/*.{ts,mts,tsx,vue}'],
|
|
},
|
|
|
|
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
|
|
|
|
pluginVue.configs['flat/essential'],
|
|
vueTsConfigs.recommended,
|
|
|
|
{
|
|
...pluginVitest.configs.recommended,
|
|
files: ['src/**/__tests__/*'],
|
|
},
|
|
|
|
// 添加自定义规则配置
|
|
{
|
|
name: 'app/custom-rules',
|
|
rules: {
|
|
'@typescript-eslint/no-unused-vars': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
'no-unused-vars': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
|
}
|
|
},
|
|
|
|
skipFormatting,
|
|
)
|