-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.yaml
77 lines (66 loc) · 2.06 KB
/
react.yaml
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
extends:
- airbnb
- airbnb/hooks
- "../config/browser"
parser: "@babel/eslint-parser"
parserOptions:
sourceType: module
#plugins:
# - import # (From airbnb)
# - jsx-a11y # (From airbnb)
# - react # (From airbnb)
# - react-hooks # (From airbnb)
# Rules
rules:
# Disallow specific global variables (Disabled since we will need 'window')
no-restricted-globals: [off]
unicorn/prevent-abbreviations:
- error
- checkProperties: true
checkFilenames: false
replacements:
params: false
props: false
ref: false
allowList:
propClasses: true
useParams: true
# Restrict file extensions that may contain JS
# https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
react/jsx-filename-extension:
- error
- extensions:
- .js
- .jsx
# Prop spreading should be allowed on components
react/jsx-props-no-spreading: [off]
import/exports-last: [error]
import/group-exports: [error]
import/no-deprecated: [warn]
import/no-namespace: [error]
# Enforce a convention in module import order
# https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
import/order:
- error
- groups:
- builtin
- external
- internal
- parent
- sibling
- index
pathGroups:
- pattern: react
group: builtin
position: before
pathGroupsExcludedImportTypes:
- react
# Enforces where React component static properties should be positioned
# https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
react/static-property-placement: [off]
# Prevent usage of dangerous JSX properties (Secure output)
# https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md
react/no-danger: [error]
# Prevent missing React when using JSX
# https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
react/react-in-jsx-scope: [off]