-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
81 lines (79 loc) · 2.58 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
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
es6: true
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
// extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
'rules': {
//--------------- Semantic style rules ---------------
// allow async-await
'generator-star-spacing': 0,
// Allow "debugger" statements only during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
// Disallow modifying variables that are declared using const
'no-const-assign': 'error',
// Disallow use of this/super before calling super() in constructors.
'no-this-before-super': 'warn',
// Disallow Undeclared Variables
'no-undef': 'error',
// Disallow assignment to native objects or read-only global variables
'no-global-assign': 'error',
// Disallow unreachable code after return, throw, continue, and break statements
'no-unreachable': 'warn',
// Disallow Unused Variables
'no-unused-vars': ['warn', { args: 'none' }],
// Verify calls of super() in constructors
'constructor-super': 'warn',
// Enforce comparing typeof expressions against valid strings
'valid-typeof': 'warn',
// Disallow Case Statement Fallthrough
'no-fallthrough': 'warn',
// Disallow variable redeclaration
'no-redeclare': 'warn',
// Disallow assignment operators in conditional statements
'no-cond-assign': 'warn',
// Disallow duplicate keys in object literals
'no-dupe-keys': 'warn',
// Disallow a duplicate case label
'no-duplicate-case': 'warn',
// Require calls to isNaN() when checking for NaN
'use-isnan': 'warn',
// Require let or const instead of var
'no-var': 'warn',
//--------------- Syntactic style rules ---------------
// allow paren-less arrow functions
'arrow-parens': 0,
// Require semicolons
semi: 'warn',
// Disallow mixed spaces and tabs for indentation
'no-mixed-spaces-and-tabs': 'warn',
// Disallow trailing whitespace at the end of lines
'no-trailing-spaces': 'warn',
// Disallow multiple spaces
'no-multi-spaces': 'warn',
// Require spacing around infix operators
'space-infix-ops': 'warn',
// Enforce consistent indentation
indent: ['warn', 'tab'],
// Require Brace Style
'brace-style': ['warn', 'stroustrup'],
// Enforces spacing after commas
'comma-spacing': 'warn',
// Require newline at the end of files
'eol-last': 'warn',
// Enforce single quotes for strings
quotes: ['warn', 'single']
}
}