forked from t7tran/carbone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
51 lines (51 loc) · 4.21 KB
/
.eslintrc.json
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
{
"root" : true,
"env": {
"browser" : false,
"es6" : true,
"node" : true,
"mocha" : true
},
"plugins" : [],
"extends": "eslint:recommended",
"rules": {
"one-var" : [ "warn" , "never" ], // Disallow declaration of multiple var in one line
"space-before-blocks" : [ "warn" , "always" ], // Enforce space before {}
"space-before-function-paren" : [ "warn" , "always" ], // Enforce space before parenthesis of named function
"spaced-comment" : [ "warn" , "always" ], // Enforce space at the start of comments
"linebreak-style" : [ "warn" , "unix" ], // Use \n as breakline character
"quote-props" : [ "warn" , "as-needed" ], // Only use quotes around properties if key is not ES valid
"brace-style" : [ "warn" , "stroustrup"], // Enforce opening bracket at the end of the line
"semi" : [ "error", "always" ], // Enforce semi-colon ath end of statements
"eqeqeq" : [ "error", "always" ], // Enforce usage of === instead of ==
"dot-location" : [ "error", "property" ], // Enforce the dot be linked to the property instead of the parent
"curly" : [ "error", "all" ], // Enforce usage of brackets everywhere
"quotes" : [ "error", "single" , { "avoidEscape": true} ], // Enforce usage of single quotes instead of double
"no-cond-assign" : [ "error", "always" ], // Disallow assignment in condition
"no-dupe-args" : "error", // Disallow duplicated arguments in function
"no-dupe-keys" : "error", // Disallow duplicated keys in object
"no-duplicate-case" : "error", // Disallow duplicated case in switch
"no-empty" : "error", // Disallow empty blocks
"no-ex-assign" : "error", // Disallow reassigning exceptions in catch
"no-func-assign" : "error", // Disallow reassigning function
"no-trailing-spaces" : "error",
"no-unused-vars" : "error", // Disallow unused variables
"no-unreachable" : "error", // Disallow unreachable code
"array-callback-return" : "error", // Enforce return statements in array functions
"dot-notation" : "error", // Enforce dot notation over square brackets
"block-scoped-var" : "error", // Treat var as Block Scoped (block-scoped-var), why not using "let"? because "let" is 10 times slower than "var"
"no-sparse-arrays" : "warn", // Enforce empty slots at the end of array declaration
"no-irregular-whitespace" : "warn", // Enforce usage of whitespace
"camelcase" : "warn", // Enforce usage of CamelCase over snake_case
"no-whitespace-before-property" : "warn", // Disallow whitespace before property
"indent" : [ "warn" , 2, { "SwitchCase" : 1,
"MemberExpression" : 1 }], // Indent with 2 spaces
"no-console" : [ "error", { "allow" : [ "warn", "error", "log"] } ], // Disallow console usage for other than warn, error or log
"keyword-spacing" : [ "warn" , { "before" : true, "after" : true }], // Enforce whitespace before and after keywords
"max-statements-per-line" : [ "warn" , { "max" : 1 } ], // Disallow multiple statements per line
"key-spacing" : [ "warn" , { "beforeColon" : true,
"afterColon" : true,
"align" : "colon",
"mode" : "strict" }] // Enforce whitespace before and after colon in object
}
}