Skip to content

Commit

Permalink
[core] Update eslint-plugin-jsx-a11y (#44701)
Browse files Browse the repository at this point in the history
Signed-off-by: Zeeshan Tamboli <[email protected]>
Co-authored-by: Jose C Quintas Jr <[email protected]>
  • Loading branch information
ZeeshanTamboli and JCQuintas authored Dec 16, 2024
1 parent 86e217a commit 86cc01d
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 46 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
*/

const path = require('path');
const a11yBase = require('eslint-config-airbnb/rules/react-a11y');

const controlHasAssociatedLabelConfig = a11yBase.rules['jsx-a11y/control-has-associated-label'];

const controlHasAssociatedLabelOptions =
typeof controlHasAssociatedLabelConfig[1] === 'object' ? controlHasAssociatedLabelConfig[1] : {};

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

'material-ui/docgen-ignore-before-comment': 'error',
'material-ui/rules-of-use-theme-variants': 'error',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-material-ui": "workspace:^",
"eslint-plugin-mocha": "^10.5.0",
"eslint-plugin-react": "^7.37.2",
Expand Down
99 changes: 54 additions & 45 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 86cc01d

Please sign in to comment.