|
| 1 | +import { FlatCompat } from '@eslint/eslintrc'; |
| 2 | +import js from '@eslint/js'; |
| 3 | +import typescriptEslint from '@typescript-eslint/eslint-plugin'; |
| 4 | +import prettier from 'eslint-plugin-prettier'; |
| 5 | +import pluginVue from 'eslint-plugin-vue'; |
| 6 | +import { defineConfig, globalIgnores } from 'eslint/config'; |
| 7 | +import globals from 'globals'; |
| 8 | +import parser from 'vue-eslint-parser'; |
| 9 | + |
| 10 | +const compat = new FlatCompat({ |
| 11 | + recommendedConfig: js.configs.recommended, |
| 12 | + allConfig: js.configs.all, |
| 13 | +}); |
| 14 | + |
| 15 | +export default defineConfig([ |
| 16 | + ...pluginVue.configs['flat/recommended'], |
| 17 | + { |
| 18 | + languageOptions: { |
| 19 | + sourceType: 'module', |
| 20 | + globals: { |
| 21 | + ...globals.browser, |
| 22 | + ...globals.node, |
| 23 | + globalThis: false, |
| 24 | + window: false, |
| 25 | + }, |
| 26 | + |
| 27 | + parser: parser, |
| 28 | + ecmaVersion: 2020, |
| 29 | + |
| 30 | + parserOptions: { |
| 31 | + parser: '@typescript-eslint/parser', |
| 32 | + }, |
| 33 | + }, |
| 34 | + |
| 35 | + extends: compat.extends( |
| 36 | + 'plugin:@typescript-eslint/recommended', |
| 37 | + 'plugin:prettier/recommended', |
| 38 | + ), |
| 39 | + |
| 40 | + plugins: { |
| 41 | + prettier, |
| 42 | + '@typescript-eslint': typescriptEslint, |
| 43 | + }, |
| 44 | + |
| 45 | + rules: { |
| 46 | + 'no-console': [ |
| 47 | + 'error', |
| 48 | + { |
| 49 | + allow: ['warn', 'error'], |
| 50 | + }, |
| 51 | + ], |
| 52 | + |
| 53 | + 'vue/multi-word-component-names': 'off', |
| 54 | + 'vue/no-v-html': 'off', |
| 55 | + 'vue/no-reserved-component-names': 'off', |
| 56 | + 'vue/no-v-text-v-html-on-component': 'off', |
| 57 | + |
| 58 | + quotes: [ |
| 59 | + 2, |
| 60 | + 'single', |
| 61 | + { |
| 62 | + avoidEscape: true, |
| 63 | + }, |
| 64 | + ], |
| 65 | + }, |
| 66 | + }, |
| 67 | + globalIgnores(['**/dist']), |
| 68 | + { |
| 69 | + rules: { |
| 70 | + 'no-undef': 'off', |
| 71 | + '@typescript-eslint/no-explicit-any': 'off', |
| 72 | + }, |
| 73 | + }, |
| 74 | +]); |
0 commit comments