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:
Joe Lencioni
2016-04-06 14:21:48 -07:00
parent acbddc1083
commit f2aca29ed9
2 changed files with 16 additions and 0 deletions

View File

@@ -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 }],