@wistia/oxlint-config 0.2.0 → 0.3.0

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