UNPKG

3.85 kBPlain TextView Raw
1{
2 "parser": "babel-eslint",
3
4 "root": true,
5
6 "env": {
7 // I write for browser
8 "browser": true,
9 // in CommonJS
10 "node": true,
11 "mocha": true
12 },
13
14 "extends": "eslint:recommended",
15
16 "globals": {
17 // having some trouble getting eslint to recognize es6 features
18 "Promise": false,
19 "Set": false,
20 "Map": flase,
21 },
22
23 // plugins let use use custom rules below
24 "plugins": [
25 "babel",
26 "react"
27 ],
28
29 "ecmaFeatures": {
30 "jsx": true,
31 "es6": true,
32 },
33
34 "rules": {
35 // 0 = off
36 // 1 = warn
37 // 2 = error
38
39 // React specifc rules
40 "react/jsx-boolean-value": 0,
41 "react/jsx-closing-bracket-location": 1,
42 "react/jsx-curly-spacing": [2, "always"],
43 "react/jsx-indent-props": [1, 2],
44 "react/jsx-no-undef": 1,
45 "react/jsx-uses-react": 1,
46 "react/jsx-uses-vars": 1,
47 "react/wrap-multilines": 1,
48 "react/react-in-jsx-scope": 1,
49 "react/prefer-es6-class": 1,
50 // no binding functions in render for perf
51 "react/jsx-no-bind": 1,
52
53 // handle async/await functions correctly
54 // handle object spread
55 "babel/object-shorthand": 1,
56
57 // handle potential errors
58 "brace-style": [2, "1tbs", { "allowSingleLine": true }],
59 "comma-dangle": [2, "always-multiline"],
60 "consistent-return": 0,
61 "indent": [2, 2, {"SwitchCase": 1}],
62 "keyword-spacing": [2],
63 "max-len": [1, 100, 2, {"ignoreComments": true}],
64 "no-cond-assign": [2, "always"],
65 "no-console": 0,
66 "no-constant-condition": 2,
67 "no-control-regex": 2,
68 "no-debugger": 2,
69 "no-dupe-args": 2,
70 "no-dupe-keys": 2,
71 "no-duplicate-case": 2,
72 "no-empty-character-class": 2,
73 "no-empty": 2,
74 "no-ex-assign": 2,
75 "no-extra-boolean-cast": 2,
76 "no-extra-semi": 2,
77 "no-func-assign": 2,
78 "no-invalid-regexp": 2,
79 "no-irregular-whitespace": 2,
80 "no-negated-in-lhs": 2,
81 "no-obj-calls": 2,
82 "no-regex-spaces": 2,
83 "no-sparse-arrays": 2,
84 "no-unexpected-multiline": 2,
85 "no-unreachable": 2,
86 "no-underscore-dangle": 0,
87 "quotes": [2, "single"],
88 "semi": [2, "always"],
89 "space-before-blocks": [2, "always"],
90 "space-before-function-parentheses": [0, "never"],
91 "space-in-brackets": [0, "never"],
92 "space-in-parens": [2, "never"],
93 "space-unary-ops": [1, { "words": true, "nonwords": false }],
94 "strict": [2, "never"],
95 "use-isnan": 2,
96
97 // style
98 "curly": 2,
99 "dot-location": [2, 'property'],
100 "dot-notation": 2,
101 "eqeqeq": 2,
102 "no-alert": 2,
103 "no-else-return": 2,
104 "no-eval": 2,
105 "no-extra-bind": 2,
106 "no-fallthrough": 2,
107 "no-floating-decimal": 2,
108 "no-implied-eval": 2,
109 "no-iterator": 2,
110 "no-labels": 2,
111 "no-lone-blocks": 2,
112 "no-loop-func": 0,
113 "no-multi-spaces": 2,
114 "no-multi-str": 2,
115 "no-native-reassign": 2,
116 "no-new-func": 2,
117 "no-new-wrappers": 2,
118 "no-new": 2,
119 "no-octal-escape": 2,
120 "no-octal": 2,
121 "no-proto": 2,
122 "no-redeclare": 2,
123 "no-return-assign": 2,
124 "no-self-compare": 2,
125 "no-sequences": 2,
126 "no-throw-literal": 1,
127 "no-unused-expressions": 2,
128 "no-useless-call": 2,
129 "no-useless-concat": 2,
130 "no-void": 2,
131 "no-warning-comments": [1, { "terms": ["todo", "fixme", "xxx"], "location": "start" }],
132 "no-with": 2,
133 "yoda": 2,
134 "no-delete-var": 2,
135 "no-shadow-restricted-names": 2,
136 "no-shadow": [0, { "hoist": "never" }],
137 "no-undef-init": 2,
138 "no-undef": 2,
139 "no-unused-vars": 2,
140 "callback-return": 2,
141
142 // es6-specific
143 "prefer-template": 1,
144 "no-var": 1,
145 "constructor-super": 2,
146 "prefer-const": 1,
147 "prefer-spread": 2,
148 "no-dupe-class-members": 2,
149 // commented out; there's a bug where `async` functions throw an error here.
150 //"generator-star-spacing": [0, { "before": true, "after": false }],
151 }
152}