{"id":26535,"library":"tslint-react-a11y","title":"tslint-react-a11y","description":"JSX accessibility lint rules for TSLint, extracted from tslint-microsoft-contrib. Version 1.1.0 (latest) adds 6 new rules including react-a11y-accessible-headings and react-a11y-iframes. Provides a focused set of WCAG-compliant React rules for automated a11y checks. Unlike eslint-plugin-jsx-a11y, this integrates directly with TSLint for TypeScript projects. The package is now in long-term maintenance as TSLint is deprecated in favor of ESLint. No additional releases expected.","status":"maintenance","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/joaovieira/tslint-react-a11y","tags":["javascript","tslint","react","a11y","typescript"],"install":[{"cmd":"npm install tslint-react-a11y","lang":"bash","label":"npm"},{"cmd":"yarn add tslint-react-a11y","lang":"bash","label":"yarn"},{"cmd":"pnpm add tslint-react-a11y","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Bundles the a11y rules extracted from this dependency","package":"tslint-microsoft-contrib","optional":false},{"reason":"Peer dependency required by the tslint plugin system","package":"tslint","optional":false},{"reason":"Required for TSLint runtime and type checking","package":"typescript","optional":false}],"imports":[{"note":"This is a TSLint config package, not a programmatic library. Use config extension not code imports.","wrong":"Trying to import package via require/import statement","symbol":"tslint-react-a11y","correct":"In tslint.json: { \"extends\": [\"tslint-react-a11y\"] }"},{"note":"Rules are enabled via tslint.json rules object, not by importing the package.","wrong":"Using require('tslint-react-a11y').rules or similar","symbol":"react-a11y-accessible-headings","correct":"In tslint.json rules section: { \"react-a11y-accessible-headings\": true }"},{"note":"When using 'extends', rulesDirectory may be automatically set. Check tslint docs.","wrong":"Forgetting to specify rulesDirectory when not using extends","symbol":"RulesDirectory","correct":"In tslint.json: { \"rulesDirectory\": [\"node_modules/tslint-react-a11y/lib\"] }"}],"quickstart":{"code":"// tslint.json\n{\n  \"extends\": [\"tslint:latest\", \"tslint-react\", \"tslint-react-a11y\"],\n  \"rules\": {\n    \"react-a11y-anchors\": [true, { \"ignore-case\": false, \"ignore-whitespace\": \"trim\" }],\n    \"react-a11y-aria-unsupported-elements\": true,\n    \"react-a11y-event-has-role\": true,\n    \"react-a11y-image-button-has-alt\": true,\n    \"react-a11y-img-has-alt\": true,\n    \"react-a11y-lang\": true,\n    \"react-a11y-meta\": true,\n    \"react-a11y-props\": true,\n    \"react-a11y-proptypes\": true,\n    \"react-a11y-role\": true,\n    \"react-a11y-role-supports-aria-props\": true,\n    \"react-a11y-tabindex-no-positive\": true,\n    \"react-a11y-titles\": true,\n    // v1.1.0 new rules\n    \"react-a11y-accessible-headings\": true,\n    \"react-a11y-iframes\": true,\n    \"react-a11y-input-elements\": true,\n    \"react-a11y-mouse-event-has-key-event\": true,\n    \"react-a11y-no-onchange\": true,\n    \"react-a11y-required\": true\n  }\n}","lang":"javascript","description":"Complete tslint.json configuration enabling all accessibility rules with example option object."},"warnings":[{"fix":"Use eslint-plugin-jsx-a11y with @typescript-eslint/parser for TypeScript.","message":"TSLint is deprecated; consider migrating to ESLint with eslint-plugin-jsx-a11y.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Update rule configuration to { \"react-a11y-anchors\": [true, { \"ignore-case\": false, \"ignore-whitespace\": \"trim\" }] }","message":"Rule options changed between v1.0.0 and v1.1.0; react-a11y-anchors now accepts an object rather than boolean.","severity":"breaking","affected_versions":">=1.1.0"},{"fix":"Install tslint and typescript as devDependencies.","message":"Missing tslint and typescript peer dependencies cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Place tslint-react-a11y last in the extends array.","message":"Rules from tslint-react-a11y can conflict with tslint:latest or tslint-react rules if not properly ordered.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install --save-dev tslint","cause":"Missing tslint peer dependency","error":"Cannot find module 'tslint'"},{"fix":"Update to v1.1.0: npm install tslint-react-a11y@1.1.0","cause":"Using v1.0.0 which does not include this rule","error":"Unknown rule: react-a11y-accessible-headings"},{"fix":"Add \"rulesDirectory\": [\"node_modules/tslint-react-a11y/lib\"]","cause":"Incorrect rulesDirectory path in tslint.json","error":"TypeError: Cannot read property 'apply' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}