This repository has been archived by the owner on Nov 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path.eslintrc
executable file
·109 lines (101 loc) · 5.3 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
{
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"modules": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"octalLiterals": true,
"regexUFlag": true,
"regexYFlag": true,
"spread": true,
"superInFunctions": true,
"templateStrings": true,
"unicodeCodePointEscapes": true,
"globalReturn": true,
"jsx": true
},
"plugins": [
"react"
],
"rules": {
"no-console": 0,
// Possible errors
"comma-dangle": [1, "always-multiline"], // Allow trailing commas in objects
"no-cond-assign": 2, // disallow assignment in conditional expressions
"no-dupe-args": 2, // disallow duplicate arguments in functions
"no-dupe-keys": 2, // disallow duplicate keys when creating object literals
"no-duplicate-case": 2, // disallow a duplicate case label.
"no-empty": 2, // disallow empty statements
"no-ex-assign": 2, // disallow assigning to the exception in a catch block
"no-extra-semi": 2, // disallow unnecessary semicolons
"no-func-assign": 2, // disallow overwriting functions written as function declarations
"no-inner-declarations": 2, // disallow function or variable declarations in nested blocks
"no-invalid-regexp": 2, // disallow invalid regular expression strings in the RegExp constructor
"no-irregular-whitespace": 2, // disallow irregular whitespace outside of strings and comments
"no-negated-in-lhs": 2, // disallow negation of the left operand of an in expression
"no-obj-calls": 2, // disallow the use of object properties of the global object (Math and JSON) as functions
"no-regex-spaces": 2, // disallow multiple spaces in a regular expression literal
"no-sparse-arrays": 2, // disallow sparse arrays
"no-unreachable": 2, // disallow unreachable statements after a return, throw, continue, or break statement
"valid-typeof": 2, // Ensure that the results of typeof are compared against a valid string
// Best Practices
"semi": [2, "always"],
"curly": 2, // specify curly brace conventions for all control statements
"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-extra-bind": 2, // disallow unnecessary function binding
"no-lone-blocks": 2, // disallow unnecessary nested blocks
"no-loop-func": 2, // disallow creation of functions within loops
"no-multi-spaces": 2, // disallow use of multiple spaces
"no-warning-comments": [0, {"terms": ["todo", "fixme"], "location": "start"}], // disallow usage of configurable warning terms in comments": 2, // e.g. TODO or FIXME (off by default)
// Stylistic rules
"indent": [2, 2, {"SwitchCase": 1}], // Set tabs to be 2 spaces
"comma-spacing": [1, {"before": false, "after": true}], // enforce spacing before and after comma
"comma-style": [1, "last"], // enforce one true comma style (off by default)
"key-spacing": [1, {"beforeColon": false, "afterColon": true}], // enforces spacing between keys and values in object literal properties
"no-mixed-spaces-and-tabs": 2, // Spaces only
"no-multiple-empty-lines": [1, {"max": 2}], // max empty lines is 2
"no-nested-ternary": 1, // warning if nested ternary
"no-spaced-func": 1, // disallow space between function identifier and application
"no-trailing-spaces": 1, // disallow trailing whitespace at the end of lines
// ES6 Rules
"no-var": 2,
// For babel
"strict": 0,
// Variables
"no-undef-init": 2, // disallow use of undefined when initializing variables
"no-undefined": 2, // disallow use of undefined variable (off by default)
"no-unused-vars": 2, // disallow declaration of variables that are not used in the code
"no-use-before-define": 2, // disallow use of variables before they are defined
// React rules
"jsx-quotes": 2, // JSX Attributes must be double quotes
"react/jsx-no-undef": 2, // Disallow undeclared variables in JSX
"react/jsx-sort-props": 0, // Enforce props alphabetical sorting
"react/jsx-uses-react": 2, // Prevent React to be incorrectly marked as unused
"react/jsx-uses-vars": 2, // Prevent variables used in JSX to be incorrectly marked as unused
"react/no-did-mount-set-state": 2, // Prevent usage of setState in componentDidMount
"react/no-did-update-set-state": 2, // Prevent usage of setState in componentDidUpdate
"react/no-multi-comp": 0, // Prevent multiple component definition per file
"react/no-unknown-property": 2, // Prevent usage of unknown DOM property
"react/prop-types": 2, // Prevent missing props validation in a React component definition
"react/react-in-jsx-scope": 2, // Prevent missing React when using JSX
"react/self-closing-comp": 1, // Prevent extra closing tags for components without children
"react/wrap-multilines": 1, // Prevent missing parentheses around multilines JSX
}
}