-
-
Notifications
You must be signed in to change notification settings - Fork 531
Expand file tree
/
Copy patheslint.config.mjs
More file actions
53 lines (46 loc) · 1.49 KB
/
eslint.config.mjs
File metadata and controls
53 lines (46 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import eslint from '@eslint/js'
import pluginVue from 'eslint-plugin-vue'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import eslintConfigPrettier from 'eslint-config-prettier'
import pluginJsonc from 'eslint-plugin-jsonc'
import globals from 'globals'
export default defineConfigWithVueTs(
{
ignores: ['dist/', 'dev-dist/', 'i18n-extract/', 'components.d.ts', 'cypress/'],
},
eslint.configs.recommended,
...pluginVue.configs['flat/vue2-recommended'],
// TypeScript setup
// base = parser setup for .ts and .vue files
// eslintRecommended = disables core ESLint rules that conflict with TS
vueTsConfigs.base,
vueTsConfigs.eslintRecommended,
vueTsConfigs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.es2021,
},
},
},
{
files: ['**/*.vue'],
rules: {
'vue/no-v-html': 'off',
'vue/block-order': 'off',
'vue/no-v-text-v-html-on-component': 'off',
'vue/valid-v-slot': ['error', { allowModifiers: true }],
},
},
...pluginJsonc.configs['flat/base'],
{
files: ['src/locales/*.json'],
rules: {
'jsonc/no-dupe-keys': 'error',
'jsonc/sort-keys': ['error', 'asc', { caseSensitive: false, natural: false }],
},
},
// Prettier must be last (disables conflicting rules)
eslintConfigPrettier
)