-
Notifications
You must be signed in to change notification settings - Fork 124
/
.eslintrc.js
120 lines (120 loc) · 3.39 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
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#bulb-rules
'plugin:vue/essential',
'plugin:vue/recommended',
'plugin:vue/strongly-recommended',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard',
'prettier/standard'
],
// required to lint *.vue files
plugins: ['vue'],
// add your custom rules here
rules: {
// allow paren-less arrow functions
'arrow-parens': 'off',
quotes: [
'error',
'single',
{ allowTemplateLiterals: true, avoidEscape: true }
],
'prefer-const': 'off',
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-multi-spaces': ['error', { ignoreEOLComments: true }],
'no-template-curly-in-string': 'off',
'no-case-declarations': 'off',
// to many false positives
'vue/no-side-effects-in-computed-properties': 'off',
// fix unused var error for JSX custom tags
'vue/jsx-uses-vars': 'error',
'vue/require-default-prop': 'off',
'vue/name-property-casing': ['error', 'kebab-case'],
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
'vue/html-indent': [
'error',
2,
{
attribute: 1,
baseIndent: 0,
closeBracket: 0,
alignAttributesVertically: true
}
],
'vue/html-self-closing': [
'error',
{
html: {
void: 'never',
normal: 'always',
component: 'always'
},
svg: 'always',
math: 'always'
}
],
'vue/html-closing-bracket-spacing': [
'error',
{
startTag: 'never',
endTag: 'never',
selfClosingTag: 'never'
}
],
'vue/no-v-html': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/array-bracket-spacing': ['error', 'never'],
'vue/arrow-spacing': ['error', { before: true, after: true }],
'vue/block-spacing': ['error', 'always'],
'vue/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'vue/camelcase': ['error', { properties: 'never' }],
'vue/comma-dangle': [
'error',
{
arrays: 'never',
objects: 'never',
imports: 'never',
exports: 'never',
functions: 'never'
}
],
'vue/dot-location': ['error', 'property'],
'vue/eqeqeq': ['error', 'always', { null: 'ignore' }],
'vue/key-spacing': ['error', { beforeColon: false, afterColon: true }],
'vue/keyword-spacing': ['error', { before: true, after: true }],
'vue/no-empty-pattern': 'error',
'vue/no-irregular-whitespace': 'error',
'vue/object-curly-spacing': ['error', 'always'],
'vue/space-infix-ops': 'error',
'vue/space-unary-ops': ['error', { words: true, nonwords: false }],
'vue/max-attributes-per-line': ['error', { singleline: 100, multiline: 1 }]
},
overrides: [
{
files: ['**/test/**', '*.spec.js'],
env: {
mocha: true
},
globals: {
expect: true
}
},
{
files: ['*.ts'],
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module'
},
plugins: ['@typescript-eslint']
}
]
}