-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
122 lines (121 loc) · 3.12 KB
/
.eslintrc.cjs
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
const BASE_DIR = '.';
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
// Don't forget to also update plugin configuration in .pre-commit-config.yaml !
'plugin:vue/vue3-strongly-recommended',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'@vue/typescript/recommended',
'plugin:vue-scoped-css/vue3-recommended',
],
overrides: [
{
files: ['*.ts', '*.vue'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'error',
},
},
],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
project: `${BASE_DIR}/tsconfig.eslint.json`,
extraFileExtensions: ['.vue'],
},
plugins: ['vue', 'cypress', 'no-relative-import-paths'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-var': 'error',
semi: 'error',
'no-useless-return': 'error',
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'prefer-const': 'error',
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
},
],
indent: ['error', 2, { SwitchCase: 1 }],
camelcase: 'error',
'max-len': ['error', 140],
quotes: ['error', 'single', { avoidEscape: true }],
eqeqeq: 'error',
'dot-notation': 'error',
'no-alert': 'error',
'comma-spacing': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_[a-z]\\S*$',
},
],
'eol-last': 'error',
'no-useless-concat': 'error',
'prefer-template': 'error',
'spaced-comment': [
'error',
'always',
{
block: { balanced: true },
},
],
'array-bracket-spacing': 'error',
'arrow-parens': 'error',
'arrow-spacing': 'error',
'block-spacing': 'error',
'brace-style': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'vue/html-indent': ['error', 2],
'vue/no-deprecated-slot-attribute': 'off',
'vue/component-name-in-template-casing': [
'error',
'kebab-case',
{
registeredComponentsOnly: false,
},
],
'vue/block-tag-newline': [
'error',
{
singleline: 'always',
multiline: 'always',
maxEmptyLines: 0,
},
],
'vue/padding-line-between-blocks': 'error',
'vue/no-spaces-around-equal-signs-in-attribute': 'error',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'always',
component: 'always',
},
},
],
'vue/singleline-html-element-content-newline': 'off',
'no-relative-import-paths/no-relative-import-paths': [
'error',
{
allowSameFolder: false,
prefix: '@',
},
],
},
};