-
Notifications
You must be signed in to change notification settings - Fork 27
/
.eslintrc.js
112 lines (110 loc) · 3.59 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
module.exports = {
root: true,
parser: 'vue-eslint-parser',
parserOptions: {
extraFileExtensions: ['.vue'],
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
env: {
'es2020': true,
'browser': true,
'es2021': true,
'amd': true,
'node': true,
'vue/setup-compiler-macros': true,
'jest/globals': true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-essential',
'eslint:recommended',
],
plugins: [
'@typescript-eslint',
'vue',
'jest',
],
globals: {
__statics: true,
process: true,
},
rules: {
// allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'comma-dangle': ['error', 'always-multiline'],
'indent': ['error', 4],
'quotes': ['error', 'single'],
'eol-last': ['error', 'always'],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'no-trailing-spaces': 'error',
'eqeqeq': 'error',
'semi': ['error', 'always'],
'arrow-parens': [2, 'as-needed', { 'requireForBlockBody': true }],
'arrow-body-style': ['error', 'as-needed'],
'object-property-newline': ['error', { 'allowAllPropertiesOnSameLine': true }],
'curly': 'error',
'brace-style': ['error', '1tbs', { 'allowSingleLine': false }],
'no-restricted-imports': ['error', {
}],
'no-return-assign': ['error', 'always'],
'no-param-reassign': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'vue/html-indent': ['warn', 4, { 'baseIndent': 0 }],
'vue/max-attributes-per-line': ['warn', {
'singleline': {
'max': 3,
},
'multiline': {
'max': 1,
},
}],
'vue/first-attribute-linebreak': ['error', {
'singleline': 'ignore',
'multiline': 'below',
}],
'vue/component-tags-order': ['error', {
'order': ['script', 'template', 'style'],
}],
'vue/html-self-closing': ['error', {
'html': {
'void': 'never',
'normal': 'never',
'component': 'always',
},
'svg': 'always',
}],
'vue/multi-word-component-names': 'error',
'vue/no-static-inline-styles': ['error', {
'allowBinding': false,
}],
'vue/attributes-order': ['error', {
'order': [
'DEFINITION',
'LIST_RENDERING',
'CONDITIONALS',
'RENDER_MODIFIERS',
'GLOBAL',
['UNIQUE', 'SLOT'],
'TWO_WAY_BINDING',
'OTHER_DIRECTIVES',
'OTHER_ATTR',
'EVENTS',
'CONTENT',
],
'alphabetical': false,
}],
'vue/html-closing-bracket-newline': ['error', {
'singleline': 'never',
'multiline': 'always',
}],
'vue/component-options-name-casing': ['error', 'PascalCase'],
'vue/component-definition-name-casing': ['error', 'PascalCase'],
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
},
};