mirror of
https://github.com/airbnb/javascript.git
synced 2026-04-25 03:00:19 -04:00
Add note and rule about redundant alt text
Screenreaders already announce `img` elements as images, so there is no need to include this information in the alt text. This will give people using assistive technologies a smoother experience.
This commit is contained in:
4
packages/eslint-config-airbnb/rules/react.js
vendored
4
packages/eslint-config-airbnb/rules/react.js
vendored
@@ -13,6 +13,10 @@ module.exports = {
|
||||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-uses-alt.md
|
||||
'jsx-a11y/img-uses-alt': 2,
|
||||
|
||||
// Prevent img alt text from containing redundant words like "image", "picture", or "photo"
|
||||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/redundant-alt.md
|
||||
'jsx-a11y/redundant-alt': 2,
|
||||
|
||||
// Prevent missing displayName in a React component definition
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
|
||||
'react/display-name': [0, { 'ignoreTranspilerName': false }],
|
||||
|
||||
Reference in New Issue
Block a user