Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
[eslint config] [breaking] update eslint-plugin-jsx-a11y to v4, enabl…
Browse files Browse the repository at this point in the history
…e new rules
  • Loading branch information
ljharb committed Feb 5, 2017
1 parent 6435f8f commit 2c390ec
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/eslint-config-airbnb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"peerDependencies": {
"eslint": "^3.15.0",
"eslint-plugin-jsx-a11y": "^3.0.2 || ^4.0.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-react": "^6.9.0"
},
Expand Down
28 changes: 27 additions & 1 deletion packages/eslint-config-airbnb/rules/react-a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {

// Require ARIA roles to be valid and non-abstract
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md
'jsx-a11y/aria-role': 'error',
'jsx-a11y/aria-role': ['error', { ignoreNonDom: false }],

// Enforce all aria-* props are valid.
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-props.md
Expand Down Expand Up @@ -92,6 +92,12 @@ module.exports = {
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/lang.md
'jsx-a11y/lang': 'error',

// prevent distracting elements, like <marquee> and <blink>
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-distracting-elements.md
'jsx-a11y/no-distracting-elements': ['error', {
elements: ['marquee', 'blink'],
}],

// only allow <th> to have the "scope" attr
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/scope.md
'jsx-a11y/scope': 'error',
Expand All @@ -104,5 +110,25 @@ module.exports = {
// Enforce that DOM elements without semantic behavior not have interaction handlers
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
'jsx-a11y/no-static-element-interactions': 'error',

// ensure emoji are accessible
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md
'jsx-a11y/accessible-emoji': 'error',

// elements with aria-activedescendant must be tabbable
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',

// ensure iframe elements have a unique title
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/iframe-has-title.md
'jsx-a11y/iframe-has-title': 'error',

// prohibit autoFocus prop
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md
'jsx-a11y/no-autofocus': 'error',

// ensure HTML elements do not specify redundant ARIA roles
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-redundant-roles.md
'jsx-a11y/no-redundant-roles': 'error',
},
};

0 comments on commit 2c390ec

Please sign in to comment.