You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[New] add support for Flat Config [`6b5f096`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/6b5f096f10b47326d68e2893152a48a79c8555b4)
18
+
- Revert "[Fix]`isNonInteractiveElement`: Upgrade aria-query to 5.3.0 and axobject-query to 3.2.1" [`75d5dd7`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/75d5dd722bd67186d97afa7b151fd6fee5885c70)
19
+
-[Robustness] use `safe-regex-test`[`4c7e781`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/4c7e7815c12a797587bb8e3cdced7f3003848964)
-[Deps] pin `aria-query` and `axobject-query`, add `ls-engines` test to CI [`32fd82c`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/32fd82c628d7f3e4ec8c06a1994f4eca1be2be4f)
-[New]`no-noninteractive-element-to-interactive-role`: allow `menuitemradio` and `menuitemcheckbox` on <li>[`c0733f9`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/c0733f94031fe3eec6b4d54176afe47929bb0a84)
-[Deps] move `object.entries` to dev deps [`1be7b70`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/commit/1be7b709eececd83f1d5f67a60b2c97cfe9a561d)
**Note:** If you installed ESLint globally (using the `-g` flag in npm, or the `global` prefix in yarn) then you must also install `eslint-plugin-jsx-a11y` globally.
62
62
63
-
## Usage
63
+
<aid="usage"></a>
64
+
## Usage - Legacy Config (`.eslintrc`)
64
65
65
66
Add `jsx-a11y` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
66
67
@@ -109,6 +110,94 @@ Add `plugin:jsx-a11y/recommended` or `plugin:jsx-a11y/strict` in `extends`:
109
110
}
110
111
```
111
112
113
+
## Usage - Flat Config (`eslint.config.js`)
114
+
115
+
The default export of `eslint-plugin-jsx-a11y` is a plugin object.
There are two shareable configs, provided by the plugin.
147
+
148
+
-`flatConfigs.recommended`
149
+
-`flatConfigs.strict`
150
+
151
+
#### CJS
152
+
153
+
```js
154
+
constjsxA11y=require('eslint-plugin-jsx-a11y');
155
+
156
+
exportdefault [
157
+
jsxA11y.flatConfigs.recommended,
158
+
{
159
+
// Your additional configs and overrides
160
+
},
161
+
];
162
+
```
163
+
164
+
#### ESM
165
+
166
+
```js
167
+
importjsxA11yfrom'eslint-plugin-jsx-a11y';
168
+
169
+
exportdefault [
170
+
jsxA11y.flatConfigs.recommended,
171
+
{
172
+
// Your additional configs and overrides
173
+
},
174
+
];
175
+
```
176
+
177
+
**Note**: Our shareable config do configure `files` or [`languageOptions.globals`](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuration-objects).
178
+
For most of the cases, you probably want to configure some of these properties yourself.
To enable your custom components to be checked as DOM elements, you can set global settings in your configuration file by mapping each custom component name to a DOM element type.
@@ -126,7 +215,7 @@ will be evaluated as an `h3`. If no `polymorphicPropName` is set, then the compo
126
215
127
216
To restrict polymorphic linting to specified components, additionally set `polymorphicAllowList` to an array of component names.
128
217
129
-
⚠️ Polymorphic components can make code harder to maintain; please use this feature with caution.
218
+
⚠️ Polymorphic components can make code harder to maintain; please use this feature with caution.
0 commit comments