Improve accessibility to meet WCAG 2.1 Level AA standards. Changes: Added eslint-plugin-jsx-a11y, keyboard navigation, ARIA labels, SkipLink component, main-content landmark. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
import nextTs from "eslint-config-next/typescript";
|
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
|
|
const eslintConfig = defineConfig([
|
|
...nextVitals,
|
|
...nextTs,
|
|
{
|
|
rules: {
|
|
// Enable recommended jsx-a11y rules (plugin already included in nextVitals)
|
|
...jsxA11y.configs.recommended.rules,
|
|
// Enforce stricter accessibility rules
|
|
"jsx-a11y/anchor-is-valid": "error",
|
|
"jsx-a11y/alt-text": "error",
|
|
"jsx-a11y/aria-props": "error",
|
|
"jsx-a11y/aria-proptypes": "error",
|
|
"jsx-a11y/aria-unsupported-elements": "error",
|
|
"jsx-a11y/role-has-required-aria-props": "error",
|
|
"jsx-a11y/role-supports-aria-props": "error",
|
|
"jsx-a11y/label-has-associated-control": "error",
|
|
"jsx-a11y/click-events-have-key-events": "warn",
|
|
"jsx-a11y/no-static-element-interactions": "warn",
|
|
"jsx-a11y/interactive-supports-focus": "warn",
|
|
},
|
|
},
|
|
// Override default ignores of eslint-config-next.
|
|
globalIgnores([
|
|
// Default ignores of eslint-config-next:
|
|
".next/**",
|
|
"out/**",
|
|
"build/**",
|
|
"next-env.d.ts",
|
|
]),
|
|
]);
|
|
|
|
export default eslintConfig;
|