-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathreact.js
64 lines (55 loc) · 1.9 KB
/
react.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
module.exports = {
plugins: [
"deprecate",
"matrix-org",
"react",
"react-hooks",
],
extends: [
"prettier",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
rules: {
// handled by prettier
"max-len": "off",
// This just uses the React plugin to help ESLint known when
// variables have been used in JSX
"react/jsx-uses-vars": ["error"],
// Don't mark React as unused if we're using JSX
"react/jsx-uses-react": ["error"],
// Components in JSX should always be defined
"react/jsx-no-undef": ["error"],
// Assert spacing before self-closing JSX tags, and no spacing before
// or after the closing slash, and no spacing after the opening
// bracket of the opening tag or closing tag.
// https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-tag-spacing.md
"react/jsx-tag-spacing": ["error", {
beforeClosing: "never",
}],
"react/jsx-curly-spacing": ["error", "never", { allowMultiline: true }],
"react/jsx-curly-brace-presence": ["error", "never"],
"react/jsx-equals-spacing": ["error", "never"],
"react/no-direct-mutation-state": ["error"],
"react/no-this-in-sfc": ["error"],
"react/self-closing-comp": ["error"],
"react/jsx-max-props-per-line": ["error", { "when": "multiline" }],
"react-hooks/rules-of-hooks": ["error"],
"react-hooks/exhaustive-deps": ["error"],
"react/no-unknown-property": ["error"],
"deprecate/import": [
"error",
{
name: "enzyme",
use: "@testing-library/react",
},
{
name: "react-dom/test-utils",
use: "@testing-library/react",
},
],
},
};