-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
85 lines (81 loc) · 2.1 KB
/
eslint.config.js
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
import js from '@eslint/js'
import ts from 'typescript-eslint'
import vue from 'eslint-plugin-vue'
import vueParser from 'vue-eslint-parser'
import globals from 'globals'
export default ts.config(
{
ignores: ['.eslintrc.cjs', './src/generated.ts'],
},
{
files: ['**/*.vue'],
extends: [
...vue.configs['flat/recommended'],
...ts.configs.recommended,
],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: ts.parser,
},
},
rules: {
'vue/html-closing-bracket-newline': ['off'],
'vue/first-attribute-linebreak': ['off'],
'vue/singleline-html-element-content-newline': ['off'],
'vue/html-indent': ['warn', 2, {
alignAttributesVertically: false,
}],
'vue/max-attributes-per-line': ['warn', {
singleline: { max: Number.POSITIVE_INFINITY },
multiline: { max: 1 },
}],
'vue/html-self-closing': ['warn', {
'html': { 'normal': 'never', 'void': 'always' },
}],
'vue/component-name-in-template-casing': ['warn', 'PascalCase' ],
},
},
{
files: ['**/*.ts'],
extends: [
...ts.configs.recommended,
],
},
{
files: ['**/*.ts', '**/*.vue'],
rules: {
'@typescript-eslint/no-empty': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'prefer-const': 'warn',
},
},
{
files: ['*.js', '**/*.js'],
...js.configs.recommended,
rules: {
'no-empty': 'off',
'no-empty-function': 'warn',
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'prefer-const': 'warn',
},
},
{
languageOptions: {
globals: {
...globals.es2024,
...globals.browser,
},
},
rules: {
indent: ['warn', 2, { SwitchCase: 1 }],
semi: ['warn', 'never'],
quotes: ['warn', 'single'],
'comma-dangle': ['warn', 'always-multiline'],
'arrow-parens': ['warn', 'always'],
'eol-last': ['warn', 'always'],
},
},
)