Skip to content

Commit

Permalink
[eslint config] [react] [breaking] enable jsx-a11y rules:
Browse files Browse the repository at this point in the history
 - `jsx-a11y/heading-has-content`
 - `jsx-a11y/html-has-lang`
 - `jsx-a11y/lang`
 - `jsx-a11y/no-marquee`
 - `jsx-a11y/scope`
 - `jsx-a11y/href-no-hash`
 - `jsx-a11y/label-has-for`
  • Loading branch information
ljharb committed Jul 5, 2016
1 parent a6da4bb commit b4d8543
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions packages/eslint-config-airbnb/rules/react-a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ module.exports = {
'jsx-a11y/aria-unsupported-elements': 2,

// disallow href "#"
// TODO: enable
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/href-no-hash.md
'jsx-a11y/href-no-hash': [0, ['a']],
'jsx-a11y/href-no-hash': [2, ['a']],

// Require <img> to have a non-empty `alt` prop, or role="presentation"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/img-has-alt.md
Expand All @@ -38,12 +37,11 @@ module.exports = {
'jsx-a11y/img-redundant-alt': 2,

// require that JSX labels use "htmlFor"
// TODO: enable
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-for.md
'jsx-a11y/label-has-for': [0, ['label']],
'jsx-a11y/label-has-for': [2, ['label']],

// require that mouseover/out come with focus/blur, for keyboard-only users
// TODO: enable?
// TODO: evaluate
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md
'jsx-a11y/mouse-events-have-key-events': 0,

Expand Down Expand Up @@ -81,27 +79,22 @@ module.exports = {

// ensure <hX> tags have content and are not aria-hidden
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md
// TODO: enable
'jsx-a11y/heading-has-content': [0, ['']],
'jsx-a11y/heading-has-content': [2, ['']],

// require HTML elements to have a "lang" prop
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/html-has-lang.md
// TODO: enable
'jsx-a11y/html-has-lang': 0,
'jsx-a11y/html-has-lang': 2,

// require HTML element's lang prop to be valid
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/lang.md
// TODO: enable
'jsx-a11y/lang': 0,
'jsx-a11y/lang': 2,

// prevent marquee elements
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-marquee.md
// TODO: enable, pardner
'jsx-a11y/no-marquee': 0,
'jsx-a11y/no-marquee': 2,

// only allow <th> to have the "scope" attr
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/scope.md
// TODO: enable
'jsx-a11y/scope': 0,
'jsx-a11y/scope': 2,
},
};

0 comments on commit b4d8543

Please sign in to comment.