Repository navigation
Expand file tree
/
Copy pathoxlint.react.ts
More file actions
113 lines (110 loc) · 3.69 KB
/
Copy pathoxlint.react.ts
File metadata and controls
113 lines (110 loc) · 3.69 KB
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
107
108
109
110
111
112
113
import { defineConfig } from 'oxlint'
export default defineConfig({
plugins: ['react', 'jsx-a11y'],
jsPlugins: ['eslint-plugin-react-x'],
rules: {
// This is effected by `settings.jsx-a11y.components`
// "react/forbid-elements": ["error", { "forbid": ["button"] }],
'react/jsx-boolean-value': ['error', 'never'],
'react/jsx-curly-brace-presence': 'error',
'react/jsx-fragments': 'error',
'react/jsx-no-useless-fragment': 'error',
'react/jsx-props-no-spread-multi': 'error',
'react/no-array-index-key': 'error',
'react/no-children-prop': 'error',
'react/rules-of-hooks': 'error',
'react/self-closing-comp': 'error',
'react-x/component-hook-factories': 'error',
'react-x/exhaustive-deps': 'error',
'react-x/immutability': 'error',
'react-x/no-context-provider': 'error',
'react-x/no-nested-component-definitions': 'error',
'react-x/no-nested-lazy-component-declarations': 'error',
'react-x/no-unstable-default-props': 'error',
'react-x/purity': 'error',
'react-x/refs': 'error',
'react-x/set-state-in-effect': 'error',
'react-x/set-state-in-render': 'error',
'react-x/unsupported-syntax': 'error',
'react-x/use-state': 'error',
'jsx-a11y/alt-text': 'off',
'jsx-a11y/anchor-ambiguous-text': 'warn',
'jsx-a11y/anchor-has-content': 'error',
'jsx-a11y/anchor-is-valid': 'error',
'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
'jsx-a11y/aria-props': 'error',
'jsx-a11y/aria-proptypes': 'error',
'jsx-a11y/aria-role': 'error',
'jsx-a11y/aria-unsupported-elements': 'error',
'jsx-a11y/autocomplete-valid': 'warn',
'jsx-a11y/click-events-have-key-events': 'error',
'jsx-a11y/heading-has-content': 'error',
'jsx-a11y/html-has-lang': 'error',
'jsx-a11y/iframe-has-title': 'warn',
'jsx-a11y/img-redundant-alt': 'error',
'jsx-a11y/label-has-associated-control': 'error',
'jsx-a11y/lang': 'error',
'jsx-a11y/media-has-caption': 'off',
'jsx-a11y/no-access-key': 'error',
'jsx-a11y/no-aria-hidden-on-focusable': 'error',
'jsx-a11y/no-distracting-elements': 'error',
'jsx-a11y/no-noninteractive-tabindex': 'warn',
'jsx-a11y/no-redundant-roles': 'warn',
'jsx-a11y/no-static-element-interactions': 'error',
'jsx-a11y/prefer-tag-over-role': 'error',
'jsx-a11y/role-has-required-aria-props': 'error',
'jsx-a11y/role-supports-aria-props': 'error',
'jsx-a11y/scope': 'error',
'jsx-a11y/tabindex-no-positive': 'warn',
},
settings: {
'jsx-a11y': {
polymorphicPropName: 'as',
components: {
Button: 'button',
ButtonIcon: 'button',
ButtonIconBase: 'button',
ButtonIconLink: 'button',
ButtonIconToggle: 'button',
ButtonToggle: 'button',
Form: 'form',
Icon: 'svg',
Img: 'img',
Input: 'input',
Label: 'label',
Meter: 'meter',
Picture: 'picture',
Table: 'table',
Td: 'td',
Th: 'th',
Tr: 'tr',
// Bug: https://github.com/oxc-project/oxc/pull/19808
// "Link": "a",
// "LinkButton": "a",
// "LinkIcon": "a",
// "NavLink": "a"
},
attributes: {
for: ['htmlFor', 'for'],
href: ['href', 'to'],
},
},
react: {
version: '19.2.4',
formComponents: [
'Form',
'fetcher.Form',
'authFetcher.Form',
'infoFetcher.Form',
'tokenFetcher.Form',
'tokenFetcher.Form',
],
linkComponents: [
{ name: 'Link', attribute: 'to' },
{ name: 'LinkButton', attribute: 'to' },
{ name: 'LinkIcon', attribute: 'to' },
{ name: 'NavLink', attribute: 'to' },
],
},
},
})