-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.ts
61 lines (57 loc) · 1.8 KB
/
eslint.config.ts
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
import jsEslint from '@eslint/js'
import type { TSESLint } from '@typescript-eslint/utils'
import unoCssConfig from '@unocss/eslint-config/flat'
import configPrettier from 'eslint-config-prettier'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
import pluginVue from 'eslint-plugin-vue'
import espree from 'espree'
import globals from 'globals'
import tsEslint, { type ConfigWithExtends } from 'typescript-eslint'
import vueParser from 'vue-eslint-parser'
const configVueTsParser: ConfigWithExtends = {
languageOptions: {
parser: vueParser,
parserOptions: {
parser: {
js: espree,
ts: tsEslint.parser,
},
ecmaFeatures: {
jsx: true,
},
},
},
}
export default tsEslint.config(
{
languageOptions: {
globals: globals.browser,
},
},
jsEslint.configs.recommended,
...tsEslint.configs.recommended,
// ...tsEslint.configs.stylistic,
...(pluginVue.configs['flat/recommended'] as TSESLint.FlatConfig.ConfigArray),
configVueTsParser,
configPrettier as TSESLint.FlatConfig.Config,
unoCssConfig as unknown,
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
// TS already checks for that, and Typescript-Eslint recommends to disable it
// https://typescript-eslint.io/linting/troubleshooting#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off',
eqeqeq: ['warn', 'always', { null: 'ignore' }],
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-empty-function': 'warn',
'sort-vars': 'warn',
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
},
},
{
ignores: ['dist', 'dev-dist', 'public', 'src-tauri'],
},
)