-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.react.js
106 lines (105 loc) · 4.61 KB
/
config.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
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
import { ignores, languageOptions } from "./constants.js";
import react from "@eslint-react/eslint-plugin";
import reactCompiler from "eslint-plugin-react-compiler";
import reactHooks from "eslint-plugin-react-hooks";
import tseslint from "typescript-eslint";
export default tseslint.config({
files: ["**/*.{jsx,tsx}"],
ignores,
languageOptions,
settings: {
react: { version: "18.3.1" },
},
plugins: {
react: react,
"react-hooks": reactHooks,
"react-compiler": reactCompiler,
},
rules: {
"react/avoid-shorthand-boolean": "off",
"react/avoid-shorthand-fragment": "off",
"react/debug/class-component": "off",
"react/debug/function-component": "off",
"react/debug/hook": "off",
"react/debug/is-from-react": "off",
"react/debug/react-hooks": "off",
"react/dom/no-children-in-void-dom-elements": "error",
"react/dom/no-dangerously-set-innerhtml": "error",
"react/dom/no-dangerously-set-innerhtml-with-children": "error",
"react/dom/no-find-dom-node": "error",
"react/dom/no-missing-button-type": "error",
"react/dom/no-missing-iframe-sandbox": "error",
"react/dom/no-namespace": "error",
"react/dom/no-render-return-value": "error",
"react/dom/no-script-url": "error",
"react/dom/no-unknown-property": "error",
"react/dom/no-unsafe-iframe-sandbox": "error",
"react/dom/no-unsafe-target-blank": "error",
"react/ensure-forward-ref-using-ref": "error",
"react/hooks-extra/ensure-custom-hooks-using-other-hooks": "error",
"react/hooks-extra/ensure-use-memo-has-non-empty-deps": "error",
"react/hooks-extra/no-direct-set-state-in-use-effect": "error",
"react/hooks-extra/no-direct-set-state-in-use-layout-effect": "error",
"react/hooks-extra/no-redundant-custom-hook": "error",
"react/hooks-extra/no-unnecessary-use-callback": "error",
"react/hooks-extra/no-unnecessary-use-memo": "error",
"react/hooks-extra/prefer-use-state-lazy-initialization": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-uses-vars": "error",
"react/naming-convention/component-name": "error",
"react/naming-convention/filename": ["error", { rule: "kebab-case" }],
"react/naming-convention/filename-extension": "error",
"react/naming-convention/use-state": "error",
"react/no-access-state-in-setstate": "error",
"react/no-array-index-key": "error",
"react/no-children-count": "error",
"react/no-children-for-each": "error",
"react/no-children-map": "error",
"react/no-children-only": "error",
"react/no-children-prop": "error",
"react/no-children-to-array": "error",
"react/no-class-component": "error",
"react/no-clone-element": "error",
"react/no-comment-textnodes": "error",
"react/no-complex-conditional-rendering": "error",
"react/no-complicated-conditional-rendering": "error",
"react/no-component-will-mount": "error",
"react/no-component-will-receive-props": "error",
"react/no-component-will-update": "error",
"react/no-create-ref": "error",
"react/no-default-props": "error",
"react/no-direct-mutation-state": "error",
"react/no-duplicate-key": "error",
"react/no-implicit-key": "error",
"react/no-leaked-conditional-rendering": "error",
"react/no-missing-component-display-name": "error",
"react/no-missing-key": "error",
"react/no-nested-components": "error",
"react/no-prop-types": "error",
"react/no-redundant-should-component-update": "error",
"react/no-set-state-in-component-did-mount": "error",
"react/no-set-state-in-component-did-update": "error",
"react/no-set-state-in-component-will-update": "error",
"react/no-string-refs": "error",
"react/no-unsafe-component-will-mount": "error",
"react/no-unsafe-component-will-receive-props": "error",
"react/no-unsafe-component-will-update": "error",
"react/no-unstable-context-value": "error",
"react/no-unstable-default-props": "error",
"react/no-unused-class-component-members": "error",
"react/no-unused-state": "error",
"react/no-useless-fragment": "error",
"react/prefer-destructuring-assignment": "error",
"react/prefer-react-namespace-import": "off",
"react/prefer-read-only-props": "error",
"react/prefer-shorthand-boolean": "error",
"react/prefer-shorthand-fragment": "error",
"react/web-api/no-leaked-event-listener": "error",
"react/web-api/no-leaked-interval": "error",
"react/web-api/no-leaked-resize-observer": "error",
"react/web-api/no-leaked-timeout": "error",
"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
"react-compiler/react-compiler": "error",
},
});