-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy patheslint.config.js
95 lines (89 loc) · 2.5 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
86
87
88
89
90
91
92
93
94
95
import globals from 'globals';
import js from '@eslint/js';
import ts from 'typescript-eslint';
import vue from 'eslint-plugin-vue';
import prettier from 'eslint-plugin-prettier/recommended';
export default [
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
// js
js.configs.recommended,
{
rules: {
'no-unused-vars': 'off',
'no-undef': 'off',
},
},
// ts
...ts.configs.recommended,
{
rules: {
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
// vue
...vue.configs['flat/recommended'],
{
files: ['*.vue', '**/*.vue'],
languageOptions: {
parserOptions: {
parser: ts.parser,
},
},
},
{
rules: {
'vue/multi-word-component-names': 'off',
'vue/attribute-hyphenation': ['error', 'never'],
'vue/v-on-event-hyphenation': ['error', 'never'],
'vue/no-v-html': 'off',
'vue/block-lang': ['error', { script: { lang: 'ts' } }],
'vue/block-order': ['error', { order: ['script[setup]', 'template', 'style[scoped]'] }],
'vue/component-api-style': ['error', ['script-setup']],
'vue/component-name-in-template-casing': 'error',
'vue/custom-event-name-casing': 'error',
'vue/define-emits-declaration': 'error',
'vue/define-macros-order': [
'error',
{
order: ['defineOptions', 'defineModel', 'defineProps', 'defineEmits', 'defineSlots'],
defineExposeLast: true,
},
],
'vue/define-props-declaration': 'error',
'vue/html-button-has-type': 'error',
'vue/no-multiple-objects-in-class': 'warn',
'vue/no-root-v-if': 'error',
'vue/no-template-target-blank': 'error',
'vue/no-undef-components': 'warn',
'vue/no-undef-properties': 'warn',
'vue/no-unused-refs': 'warn',
'vue/no-use-v-else-with-v-for': 'error',
'vue/no-useless-mustaches': 'warn',
'vue/no-useless-v-bind': 'warn',
'vue/no-v-text': 'error',
'vue/padding-line-between-blocks': 'warn',
'vue/prefer-define-options': 'error',
'vue/prefer-separate-static-class': 'warn',
'vue/prefer-true-attribute-shorthand': 'warn',
'vue/require-macro-variable-name': 'error',
'vue/require-typed-ref': 'warn',
'vue/v-for-delimiter-style': 'error',
'vue/valid-define-options': 'error',
},
},
// prettier
prettier,
{
rules: {
'prettier/prettier': 'warn',
},
},
];