82 lines
2.0 KiB
JavaScript
82 lines
2.0 KiB
JavaScript
import js from '@eslint/js'
|
|
import pluginVue from 'eslint-plugin-vue'
|
|
import * as parserVue from 'vue-eslint-parser'
|
|
import * as parserTypeScript from '@typescript-eslint/parser'
|
|
import pluginTypeScript from '@typescript-eslint/eslint-plugin'
|
|
|
|
export default [
|
|
{
|
|
ignores: ['node_modules', 'dist', '*.d.ts']
|
|
},
|
|
js.configs.recommended,
|
|
...pluginVue.configs['flat/recommended'],
|
|
{
|
|
files: ['**/*.vue'],
|
|
languageOptions: {
|
|
parser: parserVue,
|
|
parserOptions: {
|
|
parser: parserTypeScript,
|
|
sourceType: 'module',
|
|
ecmaVersion: 'latest',
|
|
extraFileExtensions: ['.vue']
|
|
},
|
|
globals: {
|
|
window: 'readonly',
|
|
document: 'readonly',
|
|
localStorage: 'readonly',
|
|
console: 'readonly',
|
|
HTMLDivElement: 'readonly',
|
|
HTMLElement: 'readonly',
|
|
ResizeObserver: 'readonly'
|
|
}
|
|
},
|
|
rules: {
|
|
'vue/multi-word-component-names': 'off',
|
|
'vue/no-v-html': 'off',
|
|
'vue/require-default-prop': 'off',
|
|
'vue/no-required-prop-with-default': 'off',
|
|
'no-unused-vars': 'off'
|
|
}
|
|
},
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
languageOptions: {
|
|
parser: parserTypeScript,
|
|
parserOptions: {
|
|
sourceType: 'module',
|
|
ecmaVersion: 'latest'
|
|
},
|
|
globals: {
|
|
window: 'readonly',
|
|
document: 'readonly',
|
|
localStorage: 'readonly',
|
|
console: 'readonly',
|
|
process: 'readonly',
|
|
__dirname: 'readonly'
|
|
}
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': pluginTypeScript
|
|
},
|
|
rules: {
|
|
...pluginTypeScript.configs.recommended.rules,
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
'@typescript-eslint/no-empty-object-type': 'off',
|
|
'no-undef': 'off'
|
|
}
|
|
},
|
|
{
|
|
files: ['vite.config.ts'],
|
|
languageOptions: {
|
|
globals: {
|
|
process: 'readonly',
|
|
__dirname: 'readonly'
|
|
}
|
|
},
|
|
rules: {
|
|
'no-undef': 'off'
|
|
}
|
|
}
|
|
]
|