-
Notifications
You must be signed in to change notification settings - Fork 40
/
eslint.config.mjs
142 lines (123 loc) · 3.14 KB
/
eslint.config.mjs
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import unusedImports from 'eslint-plugin-unused-imports'
import globals from 'globals'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'
import stylisticTs from '@stylistic/eslint-plugin-ts'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
})
export default [
{
ignores: ['**/coverage', '**/dist', '**/node_modules']
},
...compat.extends(
'eslint:recommended',
'./eslint-vue-ts-recommended.cjs',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'prettier'
),
{
plugins: {
'unused-imports': unusedImports,
'@stylistic/ts': stylisticTs
},
linterOptions: {
reportUnusedDisableDirectives: true
},
languageOptions: {
ecmaVersion: 5,
sourceType: 'script',
parserOptions: {
parser: '@typescript-eslint/parser'
}
},
rules: {
'no-console': 'warn',
'no-debugger': 'warn',
'no-empty': [
'error',
{
allowEmptyCatch: true
}
],
eqeqeq: 'error',
'vue/eqeqeq': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@stylistic/ts/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'none'
},
singleline: {
delimiter: 'semi'
}
}
],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': 'off',
'vue/require-default-prop': 'off',
'vue/no-v-html': 'off',
'vue/block-lang': [
'error',
{
script: {
lang: 'ts'
},
style: {
lang: 'scss'
}
}
],
'vue/component-api-style': ['error', ['script-setup']],
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
'vue/v-on-event-hyphenation': [
'error',
'always',
{
autofix: true
}
],
'vue/v-on-function-call': 'error',
'vue/no-template-target-blank': 'error',
'vue/prefer-true-attribute-shorthand': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': 'error'
}
},
{
files: ['**/*.cjs'],
ignores: ['*/**/*.cjs'],
languageOptions: {
globals: {
...globals.node
}
},
rules: {
'@typescript-eslint/no-var-requires': 'off'
}
},
...compat.extends('plugin:cypress/recommended').map(config => ({
...config,
files: ['**/tests/e2e/**/*.{js,cjs,jsx,ts,tsx}']
})),
{
files: ['**/tests/e2e/**/*.{js,cjs,jsx,ts,tsx}'],
languageOptions: {
globals: {
...globals.node
}
}
}
]