-
Notifications
You must be signed in to change notification settings - Fork 4
/
browser.js
76 lines (76 loc) · 2.6 KB
/
browser.js
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
module.exports = {
env: {
browser: true
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
plugins: ["react"],
settings: {
react: {
pragma: "preact"
}
},
extends: "./base.js",
rules: {
"capitalized-comments": "off",
"class-methods-use-this": [
"error",
{
// https://github.com/eslint/eslint/issues/7085#issuecomment-250465391
exceptMethods: [
"componentDidMount",
"componentDidUpdate",
"componentWillMount",
"componentWillReceiveProps",
"componentWillUnmount",
"componentWillUpdate",
"render",
"shouldComponentUpdate"
]
}
],
"eol-last": ["error", "always"],
"no-var": "warn",
"object-shorthand": ["warn", "always"],
"react/jsx-curly-spacing": ["error", { when: "never", children: true }],
"react/jsx-key": "warn",
"react/jsx-no-bind": ["error", { ignoreRefs: true }],
"react/jsx-no-comment-textnodes": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-undef": "error",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/no-direct-mutation-state": "error",
"react/no-find-dom-node": "error",
"react/no-is-mounted": "error",
"react/no-string-refs": "error",
"react/prefer-es6-class": "error",
"react/prefer-stateless-function": "warn",
"react/require-render-return": "error",
"react/self-closing-comp": ["error", { html: false, component: true }],
"jsx-quotes": "error",
"react/jsx-closing-bracket-location": ["error", "after-props"],
"react/jsx-closing-tag-location": "error",
"react/jsx-equals-spacing": "error",
"react/jsx-curly-brace-presence": ["error", "never"],
"react/jsx-pascal-case": "error",
"react/jsx-tag-spacing": ["error", {
closingSlash: "never",
beforeSelfClosing: "never",
afterOpening: "never"
}],
"react/jsx-wrap-multilines": ["error", {
declaration: "parens-new-line",
assignment: "parens-new-line",
return: "parens-new-line",
arrow: "parens-new-line",
condition: "parens-new-line",
logical: "parens-new-line",
prop: "parens-new-line"
}],
"react/react-in-jsx-scope": "error"
}
};