Skip to content

Commit 86cc01d

Browse files
[core] Update eslint-plugin-jsx-a11y (#44701)
Signed-off-by: Zeeshan Tamboli <[email protected]> Co-authored-by: Jose C Quintas Jr <[email protected]>
1 parent 86e217a commit 86cc01d

File tree

3 files changed

+71
-46
lines changed

3 files changed

+71
-46
lines changed

.eslintrc.js

+16
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
*/
66

77
const path = require('path');
8+
const a11yBase = require('eslint-config-airbnb/rules/react-a11y');
9+
10+
const controlHasAssociatedLabelConfig = a11yBase.rules['jsx-a11y/control-has-associated-label'];
11+
12+
const controlHasAssociatedLabelOptions =
13+
typeof controlHasAssociatedLabelConfig[1] === 'object' ? controlHasAssociatedLabelConfig[1] : {};
814

915
const OneLevelImportMessage = [
1016
'Prefer one level nested imports to avoid bundling everything in dev mode or breaking CJS/ESM split.',
@@ -158,6 +164,16 @@ module.exports = /** @type {Config} */ ({
158164
],
159165
// We are a library, we need to support it too
160166
'jsx-a11y/no-autofocus': 'off',
167+
// Remove when issues are fixed
168+
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/959
169+
// https://github.com/airbnb/javascript/issues/3069
170+
'jsx-a11y/control-has-associated-label': [
171+
'error',
172+
{
173+
...controlHasAssociatedLabelOptions,
174+
ignoreElements: [...(controlHasAssociatedLabelOptions.ignoreElements || []), 'th', 'td'],
175+
},
176+
],
161177

162178
'material-ui/docgen-ignore-before-comment': 'error',
163179
'material-ui/rules-of-use-theme-variants': 'error',

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
"eslint-plugin-babel": "^5.3.1",
160160
"eslint-plugin-filenames": "^1.3.2",
161161
"eslint-plugin-import": "^2.31.0",
162-
"eslint-plugin-jsx-a11y": "6.7.1",
162+
"eslint-plugin-jsx-a11y": "^6.10.2",
163163
"eslint-plugin-material-ui": "workspace:^",
164164
"eslint-plugin-mocha": "^10.5.0",
165165
"eslint-plugin-react": "^7.37.2",

pnpm-lock.yaml

+54-45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)