-
Notifications
You must be signed in to change notification settings - Fork 1
/
react.js
58 lines (56 loc) · 1.61 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
import { FlatCompat } from "@eslint/eslintrc"
import jsxA11y from "eslint-plugin-jsx-a11y"
import reactConfig from "eslint-plugin-react"
import globals from "globals"
import tsEslint from "typescript-eslint"
const compat = new FlatCompat()
export default tsEslint.config(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
reactConfig.configs.flat.recommended,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
reactConfig.configs.flat["jsx-runtime"],
...compat.config({
extends: ["plugin:react-hooks/recommended"],
}),
jsxA11y.flatConfigs.recommended,
{
languageOptions: {
globals: {
...globals.serviceworker,
React: true,
JSX: true,
},
},
settings: {
react: {
version: "detect",
},
},
rules: {
"react/no-unescaped-entities": "off",
"react/forbid-foreign-prop-types": [
"warn",
{
allowInPropTypes: true,
},
],
"react/jsx-no-comment-textnodes": "warn",
"react/jsx-no-duplicate-props": "warn",
"react/jsx-no-target-blank": "warn",
"react/jsx-no-undef": "error",
"react/jsx-pascal-case": [
"warn",
{
allowAllCaps: true,
ignore: [],
},
],
"react/no-danger-with-children": "warn",
"react/no-direct-mutation-state": "warn",
"react/no-is-mounted": "warn",
"react/no-typos": "error",
"react/require-render-return": "error",
"react/style-prop-object": "warn",
},
}
)