-
Notifications
You must be signed in to change notification settings - Fork 20
/
.eslintrc
111 lines (106 loc) · 3.25 KB
/
.eslintrc
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
{
"root": true,
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true
}
},
"env": {
"browser": true,
"webextensions": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
// basic rules
"semi": 1,
"semi-style": 2,
"semi-spacing": 1,
"camelcase": 2,
"quotes": ["warn", "double", {
"avoidEscape": true,
"allowTemplateLiterals": false
}],
"brace-style": 2,
"keyword-spacing": ["error", {
"after": true
}],
// just to make sure (are defaults)
"indent": ["error", 4],
// allow console output for errors in browsers
"no-console": 0,
// technically required, because of CSP
"no-eval": 2,
"no-implied-eval": 2,
// great new EcmaScript features
"prefer-const": ["error", {
"destructuring": "all"
}],
"no-var": 1,
"prefer-arrow-callback": 1,
"implicit-arrow-linebreak": 1,
"arrow-parens": 1,
"arrow-spacing": 1,
"no-confusing-arrow": 1,
"prefer-rest-params": 2,
"prefer-spread": 2,
"prefer-template": 1,
"template-curly-spacing": 1,
"symbol-description": 2,
"object-shorthand": ["warn", "consistent-as-needed"],
"prefer-promise-reject-errors": 2,
/* "prefer-destructuring": 1, */ // https://github.com/eslint/eslint/issues/10250
"prefer-numeric-literals": 1,
// additional rules
"no-new-object": 2,
"eqeqeq": ["error", "smart"],
"curly": ["error", "all"],
"dot-location": ["error", "property"],
"dot-notation": 2,
"no-array-constructor": 2,
"no-throw-literal": 2,
"no-self-compare": 2,
"no-useless-call": 1,
/* "no-use-before-define": 1, */
"consistent-return": 2,
"spaced-comment": 1,
"no-multi-spaces": 1,
"no-new-wrappers": 2,
"no-script-url": 2,
"no-void": 1,
"vars-on-top": 1,
"yoda": ["error", "never"],
/* "no-warning-comments": 1, */ // should be enabled later
"require-await": 1,
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": false,
"ClassDeclaration": false,
"ArrowFunctionExpression": false
}
}],
"valid-jsdoc": ["error", {
"prefer": {
"return": "returns"
},
"preferType": {
"Boolean": "boolean",
"Number": "number",
"object": "Object",
"String": "string",
"HtmlElement": "HTMLElement"
},
"requireReturnType": true,
"matchDescription": ".+",
"requireParamDescription": false,
"requireReturnDescription": false
}],
"wrap-iife": ["error", "inside"],
"no-loop-func": 2,
"no-unused-expressions": 2,
// "linebreak-style": 1, // cannot be used when contributing on Windows
}
}