-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
94 lines (78 loc) · 2.29 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
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'vue-eslint-parser',
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
},
env: {
browser: true,
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: [
'standard',
'plugin:vue/recommended',
],
// required to lint *.vue files
plugins: [
'vue',
],
// add your custom rules here
'rules': {
/*
* set rules not breaking the JS code (i.e. formatting ones) to
* warning level instead of error level to avoid the
* annoying dev server "error screen" in browser (the warnings will still
* appear in dev server CLI output).
*/
// rules are set via vue/max-len
'max-len': 'off',
// force semicolons
'semi': ['warn', 'always', {
'omitLastInOneLineBlock': false,
}],
// spaces before/after if/for/while
'keyword-spacing': ['warn', {
'before': true,
'after': true,
}],
// force dangling commas in multiline dicts/arrays/function calls
'comma-dangle': ['warn', 'always-multiline'],
// do not allow paren-less arrow functions
'arrow-parens': ['warn', 'always'],
// allow async-await
'generator-star-spacing': ['warn', {
'before': true,
'after': false,
}],
// force spaces before argument list except of named functions
'space-before-function-paren': ['warn', {
'anonymous': 'always',
// named functions should not have separating space
// e.g. `function someFun() {}`
'named': 'never',
'asyncArrow': 'always',
}],
// operators like '+' should be spaced appropriately
'space-infix-ops': ['warn', { 'int32Hint': false }],
// set max number of chars in a line to 100; ignore lines with urls
'vue/max-len': ['warn', {
'code': 100,
'template': 100,
'tabWidth': 2,
'comments': 100,
'ignoreComments': false,
'ignoreTrailingComments': false,
'ignoreUrls': true,
'ignoreStrings': false,
'ignoreTemplateLiterals': false,
'ignoreRegExpLiterals': false,
}],
/*
* remaining rules
*/
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
};