-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
75 lines (69 loc) · 1.86 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
/*
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*eslint-env commonjs*/
/*eslint quote-props: ['error', "always"] */
module.exports = {
'root': true,
'parserOptions': {
'ecmaVersion': 2020,
},
'env': {
'browser': true,
'es6': true,
'webextensions': true,
},
'settings': {
'import/resolver': {
'babel-module': {
'root': ['./'],
}
}
},
'rules': {
'no-const-assign': 'error',
'prefer-const': ['warn', {
'destructuring': 'any',
'ignoreReadBeforeAssign': false
}],
'no-var': 'error',
'no-unused-vars': ['warn', { // Not make an error for debugging.
'vars': 'all',
'args': 'after-used',
'argsIgnorePattern': '^_',
'caughtErrors': 'all',
'caughtErrorsIgnorePattern': '^_', // Allow `catch (_e) {...}`
}],
'no-use-before-define': ['error', { // the measure for Temporary Dead Zone
'functions': false, // Function declarations are hoisted.
'classes': true, // Class declarations are not hoisted. We should warn it.
}],
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-undef': ['error', {
'typeof': true,
}],
// stylisitc problem
'indent': ['warn', 2, {
'SwitchCase': 1,
'MemberExpression': 1,
'CallExpression': {
'arguments': 'first',
},
'VariableDeclarator': {
'var': 2,
'let': 2,
'const': 3,
}
}],
'no-underscore-dangle': ['warn', { // Ban the name which starts with `_`.
'allowAfterThis': true, // allow after this to create a private member.
}],
'quotes': ['warn', 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true,
}],
},
};