@wistia/oxlint-config 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/javascript.mjs +13 -0
- package/configs/node.mjs +8 -0
- package/configs/playwright.mjs +7 -0
- package/configs/react.mjs +11 -0
- package/configs/storybook.mjs +7 -0
- package/configs/styled-components.mjs +7 -0
- package/configs/testing-library.mjs +7 -0
- package/configs/typescript.mjs +20 -0
- package/configs/vitest.mjs +8 -0
- package/index.mjs +24 -0
- package/package.json +10 -16
- package/rules/{base.jsonc → base.mjs} +179 -184
- package/rules/{import.jsonc → import.mjs} +30 -32
- package/rules/{node.jsonc → node.mjs} +37 -39
- package/rules/{playwright.jsonc → playwright.mjs} +52 -54
- package/rules/{promise.jsonc → promise.mjs} +20 -22
- package/rules/{react-a11y.jsonc → react-a11y.mjs} +48 -50
- package/rules/{react.jsonc → react.mjs} +55 -57
- package/rules/{storybook.jsonc → storybook.mjs} +20 -22
- package/rules/styled-components.mjs +151 -0
- package/rules/{testing-library.jsonc → testing-library.mjs} +48 -50
- package/rules/{typescript.jsonc → typescript.mjs} +134 -136
- package/rules/{vitest.jsonc → vitest.mjs} +87 -89
- package/configs/javascript.jsonc +0 -4
- package/configs/node.jsonc +0 -4
- package/configs/playwright.jsonc +0 -4
- package/configs/react.jsonc +0 -4
- package/configs/storybook.jsonc +0 -4
- package/configs/styled-components.jsonc +0 -4
- package/configs/testing-library.jsonc +0 -4
- package/configs/typescript.jsonc +0 -4
- package/configs/vitest.jsonc +0 -4
- package/jsoncLoader.d.mts +0 -10
- package/jsoncLoader.mjs +0 -27
- package/rules/styled-components.jsonc +0 -153
|
@@ -1,70 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"categories": {},
|
|
5
|
-
"rules": {
|
|
1
|
+
export const promiseRules = {
|
|
2
|
+
plugins: ['promise'],
|
|
3
|
+
rules: {
|
|
6
4
|
// Enforces the use of catch() on un-returned promises
|
|
7
5
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/catch-or-return.md
|
|
8
|
-
|
|
6
|
+
'promise/catch-or-return': 'error',
|
|
9
7
|
|
|
10
8
|
// Avoid wrapping values in Promise.resolve or Promise.reject when not needed
|
|
11
9
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/no-return-wrap.md
|
|
12
|
-
|
|
10
|
+
'promise/no-return-wrap': 'error',
|
|
13
11
|
|
|
14
12
|
// Enforce consistent param names and ordering when creating new promises
|
|
15
13
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/param-names.md
|
|
16
|
-
|
|
14
|
+
'promise/param-names': 'error',
|
|
17
15
|
|
|
18
16
|
// Return inside each then() to create readable and reusable Promise chains
|
|
19
17
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/always-return.md
|
|
20
|
-
|
|
18
|
+
'promise/always-return': 'error',
|
|
21
19
|
|
|
22
20
|
// Avoid nested then() or catch() statements
|
|
23
21
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/no-nesting.md
|
|
24
|
-
|
|
22
|
+
'promise/no-nesting': 'error',
|
|
25
23
|
|
|
26
24
|
// Avoid using promises inside of callbacks
|
|
27
25
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/no-promise-in-callback.md
|
|
28
|
-
|
|
26
|
+
'promise/no-promise-in-callback': 'error',
|
|
29
27
|
|
|
30
28
|
// Avoid calling cb() inside of a then()
|
|
31
29
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/no-callback-in-promise.md
|
|
32
|
-
|
|
30
|
+
'promise/no-callback-in-promise': 'error',
|
|
33
31
|
|
|
34
32
|
// Avoid creating new promises outside of utility libs
|
|
35
33
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/avoid-new.md
|
|
36
|
-
|
|
34
|
+
'promise/avoid-new': 'error',
|
|
37
35
|
|
|
38
36
|
// Avoid calling new on a Promise static method
|
|
39
37
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/no-new-statics.md
|
|
40
|
-
|
|
38
|
+
'promise/no-new-statics': 'error',
|
|
41
39
|
|
|
42
40
|
// Disallow return statements in finally()
|
|
43
41
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/no-return-in-finally.md
|
|
44
|
-
|
|
42
|
+
'promise/no-return-in-finally': 'error',
|
|
45
43
|
|
|
46
44
|
// Ensures the proper number of arguments are passed to Promise functions
|
|
47
45
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/valid-params.md
|
|
48
|
-
|
|
46
|
+
'promise/valid-params': 'error',
|
|
49
47
|
|
|
50
48
|
// Disallow creating new promises with paths that resolve multiple times
|
|
51
49
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/no-multiple-resolved.md
|
|
52
|
-
|
|
50
|
+
'promise/no-multiple-resolved': 'error',
|
|
53
51
|
|
|
54
52
|
// Prefer catch to then(a, b)/then(null, b) for handling errors
|
|
55
53
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/prefer-catch.md
|
|
56
|
-
|
|
54
|
+
'promise/prefer-catch': 'error',
|
|
57
55
|
|
|
58
56
|
// Prefer await to then()/catch()/finally() for reading Promise values
|
|
59
57
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/prefer-await-to-then.md
|
|
60
|
-
|
|
58
|
+
'promise/prefer-await-to-then': 'off',
|
|
61
59
|
|
|
62
60
|
// Prefer async/await to the callback pattern
|
|
63
61
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/prefer-await-to-callbacks.md
|
|
64
|
-
|
|
62
|
+
'promise/prefer-await-to-callbacks': 'off',
|
|
65
63
|
|
|
66
64
|
// Disallow use of non-standard Promise static methods
|
|
67
65
|
// https://github.com/xjamundx/eslint-plugin-promise/blob/development/docs/rules/spec-only.md
|
|
68
|
-
|
|
66
|
+
'promise/spec-only': 'error',
|
|
69
67
|
},
|
|
70
|
-
}
|
|
68
|
+
};
|
|
@@ -1,153 +1,151 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"categories": {},
|
|
5
|
-
"rules": {
|
|
1
|
+
export const reactA11yRules = {
|
|
2
|
+
plugins: ['jsx-a11y'],
|
|
3
|
+
rules: {
|
|
6
4
|
// Enforce that all elements that require alternative text have meaningful information
|
|
7
5
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/alt-text.md
|
|
8
|
-
|
|
6
|
+
'jsx_a11y/alt-text': 'error',
|
|
9
7
|
|
|
10
8
|
// Enforce that anchors have content
|
|
11
9
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-has-content.md
|
|
12
|
-
|
|
10
|
+
'jsx_a11y/anchor-has-content': 'error',
|
|
13
11
|
|
|
14
12
|
// Enforce all anchors are valid, navigable elements
|
|
15
13
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
'jsx_a11y/anchor-is-valid': [
|
|
15
|
+
'error',
|
|
18
16
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
components: ['Link'],
|
|
18
|
+
specialLink: ['to'],
|
|
19
|
+
aspects: ['noHref', 'invalidHref', 'preferButton'],
|
|
22
20
|
},
|
|
23
21
|
],
|
|
24
22
|
|
|
25
23
|
// Enforce that elements with aria-activedescendant have tabindex
|
|
26
24
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-activedescendant-has-tabindex.md
|
|
27
|
-
|
|
25
|
+
'jsx_a11y/aria-activedescendant-has-tabindex': 'error',
|
|
28
26
|
|
|
29
27
|
// Enforce that elements have valid aria-* props
|
|
30
28
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-props.md
|
|
31
|
-
|
|
29
|
+
'jsx_a11y/aria-props': 'error',
|
|
32
30
|
|
|
33
31
|
// Enforce that ARIA state and property values are valid
|
|
34
32
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-proptypes.md
|
|
35
|
-
|
|
33
|
+
'jsx_a11y/aria-proptypes': 'error',
|
|
36
34
|
|
|
37
35
|
// Enforce that elements with ARIA roles have all required attributes for that role
|
|
38
36
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/role-has-required-aria-props.md
|
|
39
|
-
|
|
37
|
+
'jsx_a11y/role-has-required-aria-props': 'error',
|
|
40
38
|
|
|
41
39
|
// Enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role
|
|
42
40
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/role-supports-aria-props.md
|
|
43
|
-
|
|
41
|
+
'jsx_a11y/role-supports-aria-props': 'error',
|
|
44
42
|
|
|
45
43
|
// Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role
|
|
46
44
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-role.md
|
|
47
|
-
|
|
45
|
+
'jsx_a11y/aria-role': 'error',
|
|
48
46
|
|
|
49
47
|
// Enforce that certain elements don't have ARIA roles, states, or properties
|
|
50
48
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/aria-unsupported-elements.md
|
|
51
|
-
|
|
49
|
+
'jsx_a11y/aria-unsupported-elements': 'error',
|
|
52
50
|
|
|
53
51
|
// Enforce that autocomplete attribute is correct
|
|
54
52
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/autocomplete-valid.md
|
|
55
|
-
|
|
53
|
+
'jsx_a11y/autocomplete-valid': 'off',
|
|
56
54
|
|
|
57
55
|
// Enforce a clickable non-interactive element has at least one keyboard event listener
|
|
58
56
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/click-events-have-key-events.md
|
|
59
|
-
|
|
57
|
+
'jsx_a11y/click-events-have-key-events': 'error',
|
|
60
58
|
|
|
61
59
|
// Enforce heading elements have content
|
|
62
60
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/heading-has-content.md
|
|
63
|
-
|
|
61
|
+
'jsx_a11y/heading-has-content': ['error', { components: [''] }],
|
|
64
62
|
|
|
65
63
|
// Enforce <html> element has lang prop
|
|
66
64
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/html-has-lang.md
|
|
67
|
-
|
|
65
|
+
'jsx_a11y/html-has-lang': 'error',
|
|
68
66
|
|
|
69
67
|
// Enforce iframe elements have a title attribute
|
|
70
68
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/iframe-has-title.md
|
|
71
|
-
|
|
69
|
+
'jsx_a11y/iframe-has-title': 'error',
|
|
72
70
|
|
|
73
71
|
// Enforce <img> alt prop does not contain the word "image", "picture", or "photo"
|
|
74
72
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/img-redundant-alt.md
|
|
75
|
-
|
|
73
|
+
'jsx_a11y/img-redundant-alt': 'error',
|
|
76
74
|
|
|
77
75
|
// Enforce that a label tag has a text label and an associated control
|
|
78
76
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/label-has-associated-control.md
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
'jsx_a11y/label-has-associated-control': [
|
|
78
|
+
'error',
|
|
81
79
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
labelComponents: [],
|
|
81
|
+
labelAttributes: [],
|
|
82
|
+
controlComponents: [],
|
|
83
|
+
assert: 'both',
|
|
84
|
+
depth: 25,
|
|
87
85
|
},
|
|
88
86
|
],
|
|
89
87
|
|
|
90
88
|
// Enforce lang attribute has a valid value
|
|
91
89
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/lang.md
|
|
92
|
-
|
|
90
|
+
'jsx_a11y/lang': 'error',
|
|
93
91
|
|
|
94
92
|
// Enforce that media elements have captions
|
|
95
93
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/media-has-caption.md
|
|
96
|
-
|
|
94
|
+
'jsx_a11y/media-has-caption': 'error',
|
|
97
95
|
|
|
98
96
|
// Enforce that onMouseOver/onMouseOut are accompanied by onFocus/onBlur
|
|
99
97
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/mouse-events-have-key-events.md
|
|
100
|
-
|
|
98
|
+
'jsx_a11y/mouse-events-have-key-events': 'error',
|
|
101
99
|
|
|
102
100
|
// Enforce that the accessKey prop is not used on any element
|
|
103
101
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-access-key.md
|
|
104
|
-
|
|
102
|
+
'jsx_a11y/no-access-key': 'error',
|
|
105
103
|
|
|
106
104
|
// Enforce autoFocus prop is not used
|
|
107
105
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-autofocus.md
|
|
108
|
-
|
|
106
|
+
'jsx_a11y/no-autofocus': ['error', { ignoreNonDOM: true }],
|
|
109
107
|
|
|
110
108
|
// Enforce distracting elements are not used
|
|
111
109
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-distracting-elements.md
|
|
112
|
-
|
|
110
|
+
'jsx_a11y/no-distracting-elements': 'error',
|
|
113
111
|
|
|
114
112
|
// Enforce tabIndex value is not greater than zero
|
|
115
113
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/tabindex-no-positive.md
|
|
116
|
-
|
|
114
|
+
'jsx_a11y/tabindex-no-positive': 'error',
|
|
117
115
|
|
|
118
116
|
// Ensure interactive elements are not assigned non-interactive roles
|
|
119
117
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-noninteractive-tabindex.md
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
'jsx_a11y/no-noninteractive-tabindex': [
|
|
119
|
+
'error',
|
|
122
120
|
{
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
tags: [],
|
|
122
|
+
roles: ['tabpanel'],
|
|
125
123
|
},
|
|
126
124
|
],
|
|
127
125
|
|
|
128
126
|
// Enforce explicit role is not redundant with implicit role of the element
|
|
129
127
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-redundant-roles.md
|
|
130
|
-
|
|
128
|
+
'jsx_a11y/no-redundant-roles': 'error',
|
|
131
129
|
|
|
132
130
|
// Enforce that non-interactive, visible elements with click handlers use the role attribute
|
|
133
131
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-static-element-interactions.md
|
|
134
|
-
|
|
132
|
+
'jsx_a11y/no-static-element-interactions': 'error',
|
|
135
133
|
|
|
136
134
|
// Enforce scope prop is only used on <th> elements
|
|
137
135
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/scope.md
|
|
138
|
-
|
|
136
|
+
'jsx_a11y/scope': 'error',
|
|
139
137
|
|
|
140
138
|
// Enforce that anchor elements have non-ambiguous text content
|
|
141
139
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-ambiguous-text.md
|
|
142
|
-
|
|
140
|
+
'jsx_a11y/anchor-ambiguous-text': 'error',
|
|
143
141
|
|
|
144
142
|
// Enforce that aria-hidden="true" is not set on focusable elements
|
|
145
143
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-aria-hidden-on-focusable.md
|
|
146
|
-
|
|
144
|
+
'jsx_a11y/no-aria-hidden-on-focusable': 'error',
|
|
147
145
|
|
|
148
146
|
// Prefer semantic HTML elements over role attributes
|
|
149
147
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/prefer-tag-over-role.md
|
|
150
148
|
// decision: left to implementer
|
|
151
|
-
|
|
149
|
+
'jsx_a11y/prefer-tag-over-role': 'off',
|
|
152
150
|
},
|
|
153
|
-
}
|
|
151
|
+
};
|
|
@@ -1,238 +1,236 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"categories": {},
|
|
5
|
-
"rules": {
|
|
1
|
+
export const reactRules = {
|
|
2
|
+
plugins: ['react'],
|
|
3
|
+
rules: {
|
|
6
4
|
// -- React Core --
|
|
7
5
|
|
|
8
6
|
// Enforce that button elements have an explicit type attribute
|
|
9
7
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
|
|
10
|
-
|
|
8
|
+
'react/button-has-type': 'error',
|
|
11
9
|
|
|
12
10
|
// Enforce boolean attributes notation in JSX (require explicit ={true})
|
|
13
11
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value
|
|
14
|
-
|
|
12
|
+
'react/jsx-boolean-value': ['error', 'always'],
|
|
15
13
|
|
|
16
14
|
// Enforce curly braces or disallow unnecessary curly braces in JSX props and children
|
|
17
15
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
|
|
18
16
|
// decision: stylistic choice best left for formatter
|
|
19
|
-
|
|
17
|
+
'react/jsx-curly-brace-presence': 'off',
|
|
20
18
|
|
|
21
19
|
// Enforce shorthand or standard form for React fragments
|
|
22
20
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
|
|
23
|
-
|
|
21
|
+
'react/jsx-fragments': 'error',
|
|
24
22
|
|
|
25
23
|
// Enforce missing key props in iterators/collection literals
|
|
26
24
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
|
|
27
|
-
|
|
25
|
+
'react/jsx-key': 'error',
|
|
28
26
|
|
|
29
27
|
// Enforce a maximum depth that JSX can be nested
|
|
30
28
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md
|
|
31
29
|
// decision: not useful enough to justify the performance cost
|
|
32
|
-
|
|
30
|
+
'react/jsx-max-depth': 'off',
|
|
33
31
|
|
|
34
32
|
// Disallow comments from being inserted as text nodes
|
|
35
33
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
|
|
36
|
-
|
|
34
|
+
'react/jsx-no-comment-textnodes': 'error',
|
|
37
35
|
|
|
38
36
|
// Disallow JSX context values from taking values that will cause needless rerenders
|
|
39
37
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md
|
|
40
|
-
|
|
38
|
+
'react/jsx-no-constructed-context-values': 'error',
|
|
41
39
|
|
|
42
40
|
// Disallow duplicate properties in JSX
|
|
43
41
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
|
|
44
42
|
// decision: stylistic choice best left for formatter
|
|
45
|
-
|
|
43
|
+
'react/jsx-no-duplicate-props': 'off',
|
|
46
44
|
|
|
47
45
|
// Disallow javascript: URLs
|
|
48
46
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
|
|
49
|
-
|
|
47
|
+
'react/jsx-no-script-url': 'error',
|
|
50
48
|
|
|
51
49
|
// Disallow target="_blank" attribute without rel="noreferrer"
|
|
52
50
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
|
|
53
|
-
|
|
51
|
+
'react/jsx-no-target-blank': 'error',
|
|
54
52
|
|
|
55
53
|
// Disallow undeclared variables in JSX
|
|
56
54
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
|
|
57
55
|
// decision: stylistic choice best left for formatter
|
|
58
|
-
|
|
56
|
+
'react/jsx-no-undef': 'off',
|
|
59
57
|
|
|
60
58
|
// Disallow unnecessary fragments
|
|
61
59
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
|
|
62
60
|
// decision: disabled — oxlint's implementation differs from @eslint-react/no-useless-fragment
|
|
63
61
|
// and produces false positives on valid patterns
|
|
64
|
-
|
|
62
|
+
'react/jsx-no-useless-fragment': 'off',
|
|
65
63
|
|
|
66
64
|
// Enforce PascalCase for user-defined JSX components
|
|
67
65
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
|
|
68
66
|
// decision: stylistic choice best left for formatter
|
|
69
|
-
|
|
67
|
+
'react/jsx-pascal-case': 'off',
|
|
70
68
|
|
|
71
69
|
// Disallow spreading props on multiple JSX elements (and merging objects)
|
|
72
70
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spread-multi.md
|
|
73
71
|
// decision: stylistic choice best left for formatter
|
|
74
|
-
|
|
72
|
+
'react/jsx-props-no-spread-multi': 'off',
|
|
75
73
|
|
|
76
74
|
// Disallow JSX prop spreading
|
|
77
75
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
|
|
78
76
|
// decision: this is a decision best left to the implementer
|
|
79
|
-
|
|
77
|
+
'react/jsx-props-no-spreading': 'off',
|
|
80
78
|
|
|
81
79
|
// Disallow Array.prototype.map() key from being an array index
|
|
82
80
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
|
|
83
|
-
|
|
81
|
+
'react/no-array-index-key': 'error',
|
|
84
82
|
|
|
85
83
|
// Disallow passing of children as props
|
|
86
84
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md
|
|
87
|
-
|
|
85
|
+
'react/no-children-prop': 'error',
|
|
88
86
|
|
|
89
87
|
// Disallow usage of dangerous JSX properties
|
|
90
88
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-danger.md
|
|
91
|
-
|
|
89
|
+
'react/no-danger': 'error',
|
|
92
90
|
|
|
93
91
|
// Report when a DOM element is using both children and dangerouslySetInnerHTML
|
|
94
92
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md
|
|
95
|
-
|
|
93
|
+
'react/no-danger-with-children': 'error',
|
|
96
94
|
|
|
97
95
|
// Disallow direct mutation of this.state
|
|
98
96
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
|
|
99
|
-
|
|
97
|
+
'react/no-direct-mutation-state': 'error',
|
|
100
98
|
|
|
101
99
|
// Disallow usage of findDOMNode
|
|
102
100
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
|
|
103
|
-
|
|
101
|
+
'react/no-find-dom-node': 'error',
|
|
104
102
|
|
|
105
103
|
// Disallow usage of isMounted
|
|
106
104
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md
|
|
107
105
|
// decision: stylistic choice best left for formatter
|
|
108
|
-
|
|
106
|
+
'react/no-is-mounted': 'off',
|
|
109
107
|
|
|
110
108
|
// Disallow defining multiple components in a single file (allow colocated stateless helpers)
|
|
111
109
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
|
|
112
110
|
// decision: stylistic choice best left for formatter
|
|
113
|
-
|
|
111
|
+
'react/no-multi-comp': 'off',
|
|
114
112
|
|
|
115
113
|
// Disallow usage of the return value of ReactDOM.render
|
|
116
114
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
|
|
117
|
-
|
|
115
|
+
'react/no-render-return-value': 'error',
|
|
118
116
|
|
|
119
117
|
// Disallow usage of setState
|
|
120
118
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
|
|
121
119
|
// decision: stylistic choice best left for formatter
|
|
122
|
-
|
|
120
|
+
'react/no-set-state': 'off',
|
|
123
121
|
|
|
124
122
|
// Disallow using string references
|
|
125
123
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md
|
|
126
124
|
// decision: stylistic choice best left for formatter
|
|
127
|
-
|
|
125
|
+
'react/no-string-refs': 'off',
|
|
128
126
|
|
|
129
127
|
// Disallow this from being used in stateless functional components
|
|
130
128
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
|
|
131
129
|
// decision: stylistic choice best left for formatter
|
|
132
|
-
|
|
130
|
+
'react/no-this-in-sfc': 'off',
|
|
133
131
|
|
|
134
132
|
// Disallow unescaped HTML entities from appearing in markup
|
|
135
133
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
|
|
136
134
|
// decision: stylistic choice best left for formatter
|
|
137
|
-
|
|
135
|
+
'react/no-unescaped-entities': 'off',
|
|
138
136
|
|
|
139
137
|
// Disallow usage of unknown DOM property
|
|
140
138
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
|
|
141
|
-
|
|
139
|
+
'react/no-unknown-property': 'error',
|
|
142
140
|
|
|
143
141
|
// Disallow usage of unsafe lifecycle methods
|
|
144
142
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md
|
|
145
143
|
// decision: stylistic choice best left for formatter
|
|
146
|
-
|
|
144
|
+
'react/no-unsafe': 'off',
|
|
147
145
|
|
|
148
146
|
// Disallow usage of deprecated methods
|
|
149
147
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-redundant-should-component-update.md
|
|
150
|
-
|
|
148
|
+
'react/no-redundant-should-component-update': 'error',
|
|
151
149
|
|
|
152
150
|
// Disallow creating unstable components inside components
|
|
153
151
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-namespace.md
|
|
154
|
-
|
|
152
|
+
'react/no-namespace': 'error',
|
|
155
153
|
|
|
156
154
|
// Disallow usage of setState in componentDidMount
|
|
157
155
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
|
|
158
|
-
|
|
156
|
+
'react/no-did-mount-set-state': 'error',
|
|
159
157
|
|
|
160
158
|
// Disallow usage of setState in componentWillUpdate
|
|
161
159
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md
|
|
162
|
-
|
|
160
|
+
'react/no-will-update-set-state': 'error',
|
|
163
161
|
|
|
164
162
|
// Disallow usage of React.Children APIs
|
|
165
163
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-react-children.md
|
|
166
164
|
// decision: stylistic choice best left for formatter
|
|
167
|
-
|
|
165
|
+
'react/no-react-children': 'off',
|
|
168
166
|
|
|
169
167
|
// Disallow usage of cloneElement
|
|
170
168
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-clone-element.md
|
|
171
|
-
|
|
169
|
+
'react/no-clone-element': 'error',
|
|
172
170
|
|
|
173
171
|
// Enforce ES5 or ES6 class for React Components
|
|
174
172
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md
|
|
175
173
|
// decision: stylistic choice best left for formatter
|
|
176
|
-
|
|
174
|
+
'react/prefer-es6-class': 'off',
|
|
177
175
|
|
|
178
176
|
// Enforce that components that only export from react can only export components
|
|
179
177
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/only-export-components.md
|
|
180
178
|
// decision: stylistic choice best left for formatter
|
|
181
|
-
|
|
179
|
+
'react/only-export-components': 'off',
|
|
182
180
|
|
|
183
181
|
// Prevent missing displayName in a React component definition
|
|
184
182
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
|
|
185
183
|
// decision: stylistic choice best left for formatter (equivalent @eslint-react/no-missing-component-display-name is "off")
|
|
186
|
-
|
|
184
|
+
'react/display-name': 'off',
|
|
187
185
|
|
|
188
186
|
// Enforce a specific function type for function components
|
|
189
187
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forward-ref-uses-ref.md
|
|
190
188
|
// decision: stylistic choice best left for formatter
|
|
191
|
-
|
|
189
|
+
'react/forward-ref-uses-ref': 'off',
|
|
192
190
|
|
|
193
191
|
// Enforce sandbox attribute on iframe elements
|
|
194
192
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/iframe-missing-sandbox.md
|
|
195
|
-
|
|
193
|
+
'react/iframe-missing-sandbox': 'error',
|
|
196
194
|
|
|
197
195
|
// Enforce checked/onChange or readonly for checkboxes
|
|
198
196
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/checked-requires-onchange-or-readonly.md
|
|
199
197
|
// decision: stylistic choice best left for formatter
|
|
200
|
-
|
|
198
|
+
'react/checked-requires-onchange-or-readonly': 'off',
|
|
201
199
|
|
|
202
200
|
// Disallow void DOM elements from receiving children
|
|
203
201
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
|
|
204
|
-
|
|
202
|
+
'react/void-dom-elements-no-children': 'error',
|
|
205
203
|
|
|
206
204
|
// Enforce component methods order
|
|
207
205
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
|
|
208
206
|
// decision: stylistic choice best left for formatter
|
|
209
|
-
|
|
207
|
+
'react/require-render-return': 'off',
|
|
210
208
|
|
|
211
209
|
// Enforce Rules of Hooks
|
|
212
210
|
// https://reactjs.org/docs/hooks-rules.html
|
|
213
|
-
|
|
211
|
+
'react/rules-of-hooks': 'error',
|
|
214
212
|
|
|
215
213
|
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
216
214
|
// https://github.com/facebook/react/issues/14920
|
|
217
|
-
|
|
215
|
+
'react/exhaustive-deps': 'error',
|
|
218
216
|
|
|
219
217
|
// Enforce JSX filename extension (allow .jsx and .tsx)
|
|
220
218
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
|
|
221
219
|
// decision: stylistic choice best left for formatter
|
|
222
|
-
|
|
220
|
+
'react/jsx-filename-extension': 'off',
|
|
223
221
|
|
|
224
222
|
// Enforce self-closing tags for components without children
|
|
225
223
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
|
|
226
224
|
// decision: stylistic choice best left for formatter
|
|
227
|
-
|
|
225
|
+
'react/self-closing-comp': 'off',
|
|
228
226
|
|
|
229
227
|
// Enforce style prop value is an object
|
|
230
228
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
|
|
231
|
-
|
|
229
|
+
'react/style-prop-object': 'error',
|
|
232
230
|
|
|
233
231
|
// Enforce event handler naming conventions in JSX
|
|
234
232
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
|
|
235
233
|
// decision: stylistic choice best left for formatter
|
|
236
|
-
|
|
234
|
+
'react/jsx-handler-names': 'off',
|
|
237
235
|
},
|
|
238
|
-
}
|
|
236
|
+
};
|