forked from vuetifyjs/vuetify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
150 lines (142 loc) Β· 4.19 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
module.exports = {
root: true,
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
},
extends: [
'standard',
'plugin:vue/recommended',
'plugin:vuetify/base',
'plugin:sonarjs/recommended',
],
env: {
node: true,
browser: true,
es6: true,
},
plugins: [
'@typescript-eslint',
'sonarjs',
],
rules: {
// allow paren-less arrow functions
'arrow-parens': ['error', 'as-needed'],
// set maximum line characters
'max-len': ['error', 140, 4, {
ignoreUrls: true,
ignoreTemplateLiterals: true,
ignoreStrings: true,
}],
'max-statements': ['error', 24],
quotes: ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: true,
}],
'no-console': 'off',
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
}],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-return-assign': 'off',
'no-unused-vars': 'error',
'no-empty': 'error',
'array-bracket-spacing': ['error', 'never'],
'object-curly-spacing': ['error', 'always'],
'space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'always',
asyncArrow: 'always',
},
],
'no-return-await': 'warn',
'object-shorthand': ['error', 'always'],
'no-extra-semi': 'error',
'prefer-const': ['error', {
destructuring: 'all',
ignoreReadBeforeAssign: true,
}],
'no-prototype-builtins': 'off',
'no-void': 'off',
'no-case-declarations': 'off',
'sonarjs/cognitive-complexity': 'off',
'sonarjs/no-duplicate-string': 'off',
// Not in override, these apply to non-.vue files too
'vue/require-default-prop': 'off',
'vue/require-prop-types': 'off',
'vue/one-component-per-file': 'off',
'vue/custom-event-name-casing': ['error', { ignores: ['/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u'] }],
},
overrides: [
{
files: '**/*.vue',
rules: {
indent: 'off',
'vue/script-indent': ['error', 2, {
baseIndent: 1,
switchCase: 1,
ignores: [],
}],
'vue/html-closing-bracket-newline': ['error', {
singleline: 'never',
multiline: 'always',
}],
'vue/html-closing-bracket-spacing': 'error',
'vue/max-attributes-per-line': ['error', {
singleline: 5,
multiline: {
max: 1,
allowFirstLine: false,
},
}],
'vue/valid-v-on': 'off', // This rule doesn't allow empty event listeners
'vue/no-v-html': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
},
},
{
files: '**/*.ts',
rules: {
// Can't overload function exports with this enabled
'import/export': 'off',
// False positives on types
'no-undef': 'off',
quotes: 'off',
'@typescript-eslint/quotes': ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: true,
}],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error', 'nofunc'],
// Enabled in tsconfig
'no-unused-vars': 'off',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: {
delimiter: 'none',
},
singleline: {
delimiter: 'comma',
},
}],
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/no-invalid-this': 'error',
},
},
],
}