forked from kubernetes/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
74 lines (73 loc) · 3.13 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
{
// This file contains root configuration for ESLint. Its rules may be overriden in a specific
// folder (e.g., tests) by placing .eslintrc in it.
// All lint rules should be placed here unless they do not apply to entire JavaScript codebase.
// For example, indentation rules should be here (applies to all JS files), but Protractor
// should not (applies only to integration tests files).
// Base rules on recommended ESLint settings.
// TODO(bryk): Determine whether there is a better base config.
"extends": "eslint:recommended",
"env": {
// Enables all ES6 features except modules.
"es6": true,
},
"parserOptions": {
// Enable ES6 modules to have all language features covered.
"sourceType": "module"
},
"rules": {
// Require parens in arrow function arguments.
"arrow-parens": [2, "always"],
// Require dangling comma at the end of any multiline list/object. This is to be consistent
// with backend code.
"comma-dangle": [2, "always-multiline"],
// Enforce newline consistency in member expressions. Dots are places on the same line as
// the property.
"dot-location": [2, "property"],
// Enforce newline at the end of file, with no multiple empty lines.
"eol-last": 2,
// Force using === and !=== except when comparing to null. This is to prevent from bugs that
// come from automatic type conversion in == operator and to be consistent across the codebase.
"eqeqeq": [2, "allow-null"],
// Require a capital letter for constructors.
"new-cap": 2,
// Disallow the omission of parentheses when invoking a constructor with no arguments.
"new-parens": 2,
// Disallow modifying constant variables.
"no-const-assign": 2,
// Disallow this keywords outside of classes or class-like objects.
"no-invalid-this": 2,
// Allow at most one newline between code blocks.
"no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 1}],
// Disallow the use of ternary operators when a simpler alternative exists.
"no-unneeded-ternary": 2,
// Disallow trailing spaces. This is to unify code because editors may have different
// settings.
"no-trailing-spaces": 2,
// Force using 'let' or 'const' instead of 'var'. This is to prevent from var hoisting bugs.
"no-var": 2,
// Require one variable declaration statement.
"one-var": [2, "never"],
// Prefer using template literals instead of strings concatenation.
"prefer-template": 2,
// Require use of the second argument for parseInt().
"radix": 2,
// Require semicolons in every place they are valid. This is to prevent from automatic
// semicolon insertion bugs.
"semi": [2, "always"],
// Disallow setting strict mode in files. All JS code in the project uses ES6 modules so is
// implicitly strict.
"strict": [2, "never"],
// Require valid JSDoc.
"valid-jsdoc": [2, {
"prefer": {
"returns": "return"
},
"requireReturnDescription": false,
"requireReturn": false,
"requireParamDescription": false
}],
// No spacing in object literals nor in imports/exports.
"object-curly-spacing": [2, "never"],
},
}