-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
201 lines (191 loc) · 5.49 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'@vue/airbnb',
'@vue/typescript/recommended',
'plugin:testing-library/vue',
],
plugins: [
'testing-library',
],
// parser: 'vue-eslint-parser',
parserOptions: {
// parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
// extraFileExtensions: ['.vue'],
// sourceType: 'module',
ecmaFeatures: {
jsx: true,
legacyDecorators: true,
},
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
// AIRBNB/CORE
'no-shadow': 'off',
'no-new': 'off',
'no-console': 'off',
'no-debugger': 'off',
'class-methods-use-this': 'off',
'no-param-reassign': 'off',
'import/no-cycle': 'off',
'import/prefer-default-export': 'off',
'max-len': ['error', { code: 180 }],
'no-underscore-dangle': 'off',
'newline-before-return': 'error',
'object-curly-newline': ['error', { consistent: true }],
'newline-after-var': 'error',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'arrow-parens': ['error', 'as-needed'],
indent: [
'error', 2,
{ ignoredNodes: ['TemplateLiteral'], SwitchCase: 0 },
],
quotes: ['error', 'single', { avoidEscape: true }],
'no-useless-constructor': 'off',
'no-unused-vars': 'off',
'no-array-constructor': 'off',
'no-empty-function': 'off',
semi: ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
// TYPESCRIPT
'@typescript-eslint/no-useless-constructor': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'none',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-explicit-any': ['error', { fixToUnknown: true }],
'@typescript-eslint/no-shadow': ['error'],
// VUE
// 'vue/singleline-html-element-content-newline': ['error', {
// ignoreWhenNoAttributes: true,
// ignoreWhenEmpty: true,
// ignores: [],
// }],
'vue/custom-event-name-casing': 2,
'vue/no-v-html': 2,
'vue/require-prop-types': 2,
'vue/require-default-prop': 2,
'vue/order-in-components': 2,
'vue/html-closing-bracket-newline': 2,
'vue/mustache-interpolation-spacing': 2,
'vue/max-attributes-per-line': ['error', {
singleline: 1,
multiline: {
max: 1,
allowFirstLine: false,
},
}],
'vue/attributes-order': 2,
'vue/component-name-in-template-casing': ['error', 'kebab-case', {
registeredComponentsOnly: true,
ignores: [],
}],
'vue/no-boolean-default': ['error', 'no-default'],
// 'vue/no-bare-strings-in-template': ['error', {
// allowlist: [
// '(', ')', ',', '.', '&', '+', '-', '=', '*', '/', '#', '%', '!', '?', ':', '[', ']', '{', '}', '<', '>', '\u00b7', '\u2022', '\u2010', '\u2013', '\u2014', '\u2212', '|',
// ],
// attributes: {
// '/.+/': ['title', 'aria-label', 'aria-placeholder', 'aria-roledescription', 'aria-valuetext'],
// input: ['placeholder'],
// img: ['alt'],
// },
// directives: ['v-text'],
// }],
'vue/no-duplicate-attr-inheritance': 2,
'vue/no-empty-component-block': 2,
'vue/no-multiple-objects-in-class': 2,
'vue/no-potential-component-option-typo': ['error', {
presets: ['vue'],
custom: [],
threshold: 1,
}],
'vue/no-reserved-component-names': ['error', {
disallowVueBuiltInComponents: true,
disallowVue3BuiltInComponents: true,
}],
'vue/no-static-inline-styles': ['error', {
allowBinding: true,
}],
'vue/no-template-target-blank': ['error', {
allowReferrer: false,
enforceDynamicLinks: 'always',
}],
'vue/no-unregistered-components': ['error', {
ignorePatterns: ['router-link', 'router-view'],
}],
'vue/no-unsupported-features': ['error', {
version: '^2.6.0',
ignores: [],
}],
'vue/no-unused-properties': ['error', {
groups: ['props'],
}],
'vue/no-useless-mustaches': ['error', {
ignoreIncludesComment: false,
ignoreStringEscape: false,
}],
'vue/no-useless-v-bind': ['error', {
ignoreIncludesComment: false,
ignoreStringEscape: false,
}],
'vue/padding-line-between-blocks': ['error', 'always'],
'vue/require-name-property': 2,
'vue/script-indent': ['error', 2, {
baseIndent: 0,
switchCase: 0,
ignores: [],
}],
'vue/static-class-names-order': 2,
'vue/v-for-delimiter-style': ['error', 'in'],
'vue/array-bracket-newline': 2,
'vue/array-bracket-spacing': 2,
'vue/arrow-spacing': 2,
'vue/block-spacing': 2,
'vue/brace-style': 2,
'vue/template-curly-spacing': 2,
'vue/prefer-template': 2,
// TESTING-LIBRARY
// @see https://github.com/testing-library/eslint-plugin-testing-library#supported-rules
'testing-library/await-async-query': 'error',
'testing-library/no-await-sync-query': 'error',
'testing-library/no-debug': 'warn',
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
],
};