This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
126 lines (125 loc) · 4.31 KB
/
.eslintrc.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
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
module.exports = {
env: {
node: true,
},
parserOptions: {
parser: {
js: 'espree',
jsx: 'espree',
ts: '@typescript-eslint/parser',
tsx: '@typescript-eslint/parser',
},
extraFileExtensions: ['.vue'],
ecmaFeatures: {
jsx: true,
},
},
plugins: ['vuejs-accessibility'],
extends: [
'@team23/eslint-config-team23-standard',
'@team23/eslint-config-team23-ts',
'plugin:vue/vue3-recommended',
'plugin:vuejs-accessibility/recommended',
],
overrides: [
{
files: [
'*.vue',
],
rules: {
// eslint-disable-next-line no-magic-numbers
'vue/html-indent': ['error', 4],
/* Optional rules not provided by vue preset */
'vue/block-lang': ['error', {
script: { lang: 'ts' },
i18n: { lang: 'yaml' },
}],
'vue/block-order': ['error', {
order: ['script[setup]', 'script', 'template', 'style', 'i18n'],
}],
'vue/block-tag-newline': 'error',
'vue/component-api-style': 'error',
'vue/component-name-in-template-casing': ['warn', 'kebab-case', {
registeredComponentsOnly: false,
}],
'vue/custom-event-name-casing': 'error',
'vue/define-emits-declaration': ['error', 'type-literal'],
'vue/define-macros-order': ['error', {
order: ['defineProps', 'defineEmits', 'defineModel', 'defineOptions', 'defineSlots'],
}],
'vue/define-props-declaration': 'error',
'vue/enforce-style-attribute': 'error',
'vue/html-comment-content-newline': 'error',
'vue/html-comment-content-spacing': 'error',
// eslint-disable-next-line no-magic-numbers
'vue/html-comment-indent': ['error', 4],
'vue/no-empty-component-block': 'error',
'vue/no-multiple-objects-in-class': 'error',
'vue/no-ref-object-reactivity-loss': 'warn',
'vue/no-required-prop-with-default': 'error',
'vue/no-root-v-if': 'warn',
'vue/no-static-inline-styles': 'error',
'vue/no-unused-emit-declarations': 'error',
'vue/no-use-v-else-with-v-for': 'error',
'vue/no-useless-mustaches': 'error',
'vue/no-useless-v-bind': 'error',
'vue/padding-line-between-blocks': 'error',
'vue/prefer-separate-static-class': 'error',
'vue/require-emit-validator': 'error',
'vue/require-macro-variable-name': 'error',
'vue/require-typed-ref': 'error',
'vue/v-for-delimiter-style': 'error',
},
},
{
files: [
'*.ts',
'*.tsx',
'*.vue',
],
rules: {
'no-unused-vars': 'off',
'no-undef': 'off',
// allow unused variables when they start with an underscore
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
},
],
},
},
{
files: [
'*.spec.ts',
'*.spec.tsx',
],
rules: {
'@typescript-eslint/no-magic-numbers': 'off',
'max-lines': 'off',
},
},
{
files: [
'*.spec.ts',
'*.spec.tsx',
'**/__mocks__/**/*.ts',
'**/__mocks__/**/*.tsx',
],
rules: {
'@typescript-eslint/no-empty-function': 'off',
},
},
{
files: [
'vite.config.ts',
'vitest.config.ts',
],
rules: {
'import/no-default-export': 'off',
},
},
],
};