This repository has been archived by the owner on Sep 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
.eslintrc
106 lines (100 loc) · 4.7 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
{
"env": {
"browser": 1,
"es6": true,
"amd": true,
"node": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"spread": true,
"templateStrings": true,
"unicodeCodePointEscapes": true,
"jsx": true
},
"plugins": [
"react"
],
"rules": {
//
//Possible Errors
//
"comma-dangle": 2, // disallow or enforce trailing commas
"no-dupe-args": 2, // disallow duplicate arguments in functions
"no-dupe-keys": 2, // disallow duplicate keys when creating object literals
"no-extra-semi": 2, // disallow unnecessary semicolons
"no-invalid-regexp": 2, // disallow invalid regular expression strings in the RegExp constructor
"no-regex-spaces": 2, // disallow multiple spaces in a regular expression literal
// Best Practices
//
"complexity": [1, 4],
"max-depth": [2, 3],
"no-extra-bind": 1, // disallow unnecessary function binding
"default-case": 2, // require default case in switch statements (off by default)
"dot-notation": 2, // encourages use of dot notation whenever possible
"eqeqeq": 2, // require the use of === and !==
"no-alert": 2, // disallow the use of alert, confirm, and prompt
"no-eval": 2, // disallow use of eval()
"no-implied-eval": 2, // disallow use of eval()-like methods
"no-loop-func": 1, // disallow creation of functions within loops
"no-redeclare": 2, // disallow declaring the same variable more then once
"no-return-assign": 2, // disallow use of assignment in return statement
"no-sequences": 2, // disallow use of comma operator
"no-with": 2, // disallow use of the with statement
"radix": 2, // require use of the second argument for parseInt() (off by default)
"wrap-iife": [2, "inside"], // require immediate function invocation to be wrapped in parentheses (off by default)
"yoda": 2, // require or disallow Yoda conditions
// Variables
//
"no-delete-var": 2, // disallow deletion of variables
"no-undef": 2, // disallow use of undeclared variables unless mentioned in a /*global */ block
// Style
//
"camelcase": 1,
"indent": [1, 2],
"comma-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after comma
"comma-style": [1, "last"],
"consistent-this": [1, "self"], // enforces consistent naming when capturing the current execution context (off by default)
"eol-last": 1, // enforce newline at the end of file, with no multiple empty lines
"key-spacing": [1, {"beforeColon": false, "afterColon": true}], // enforces spacing between keys and values in object literal properties
"new-parens": 1, // disallow the omission of parentheses when invoking a constructor with no arguments
"no-lonely-if": 1, // disallow if as the only statement in an else block (off by default)
"no-nested-ternary": 1, // disallow nested ternary expressions (off by default)
"no-spaced-func": 1, // disallow space between function identifier and application
"no-trailing-spaces": [1, { skipBlankLines: true }], // disallow trailing whitespace at the end of lines
"no-underscore-dangle": 1, // disallow dangling underscores in identifiers
"operator-assignment": [2, "always"],
"operator-linebreak": [2, "after"],
"quote-props": [1, "as-needed"], // require quotes around object literal property names (off by default)
"quotes": [2, "single"],
"semi": [1, "always"], // require or disallow use of semicolons instead of ASI
"semi-spacing": [2, {"before": false, "after": true}],
"space-infix-ops": 1, // require spaces around operators
"space-return-throw-case": 1, // require a space after return, throw, and case
"space-unary-ops": [1, {"words": true, "nonwords": false}], // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
"wrap-regex": 2,
"react/jsx-boolean-value": 1,
"react/jsx-no-undef": 1,
"react/jsx-quotes": [2, "double", "avoid-escape"], // Enforce quote style for JSX attributes
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-multi-comp": 1,
"react/no-unknown-property": 1,
"react/prop-types": 1,
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"react/wrap-multilines": 1
}
}