feat(eslint): add jsx-a11y accessibility rules as warnings

Install eslint-plugin-jsx-a11y and add 24 recommended rules to the
nextjs ESLint config, all set to warn. Baseline: 292 warnings
(207 label-has-associated-control, 52 no-static-element-interactions,
22 click-events-have-key-events, 10 no-autofocus, 1 html-has-lang).

Will be upgraded to errors after Phase 5c fixes core components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 22:59:15 +02:00
parent 6830bfb314
commit 09dcedb646
3 changed files with 148 additions and 249 deletions
+3
View File
@@ -18,5 +18,8 @@
"peerDependencies": {
"eslint": "^9.0.0",
"typescript": "^5.0.0"
},
"devDependencies": {
"eslint-plugin-jsx-a11y": "^6.10.2"
}
}
+27
View File
@@ -1,5 +1,6 @@
import baseConfig from "./base.js";
import reactHooks from "eslint-plugin-react-hooks";
import jsxA11y from "eslint-plugin-jsx-a11y";
/** @type {import("eslint").Linter.FlatConfig[]} */
export default [
@@ -7,6 +8,7 @@ export default [
{
plugins: {
"react-hooks": reactHooks,
"jsx-a11y": jsxA11y,
},
rules: {
"react-hooks/rules-of-hooks": "error",
@@ -15,6 +17,31 @@ export default [
"error",
{ checksVoidReturn: { attributes: false } },
],
// Accessibility: start as warn, upgrade to error after fixes
"jsx-a11y/alt-text": "warn",
"jsx-a11y/anchor-has-content": "warn",
"jsx-a11y/anchor-is-valid": "warn",
"jsx-a11y/aria-props": "warn",
"jsx-a11y/aria-proptypes": "warn",
"jsx-a11y/aria-role": "warn",
"jsx-a11y/aria-unsupported-elements": "warn",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/heading-has-content": "warn",
"jsx-a11y/html-has-lang": "warn",
"jsx-a11y/img-redundant-alt": "warn",
"jsx-a11y/interactive-supports-focus": "warn",
"jsx-a11y/label-has-associated-control": "warn",
"jsx-a11y/no-access-key": "warn",
"jsx-a11y/no-autofocus": "warn",
"jsx-a11y/no-distracting-elements": "warn",
"jsx-a11y/no-noninteractive-element-interactions": "warn",
"jsx-a11y/no-noninteractive-tabindex": "warn",
"jsx-a11y/no-redundant-roles": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-a11y/role-has-required-aria-props": "warn",
"jsx-a11y/role-supports-aria-props": "warn",
"jsx-a11y/scope": "warn",
"jsx-a11y/tabindex-no-positive": "warn",
},
},
];