[eslint config] [breaking] [deps] Upgrade eslint-plugin-jsx-a11y to v6

- enable more a11y rules
This commit is contained in:
Stephen Wyatt Bush
2017-07-05 15:47:54 -07:00
committed by Jordan Harband
parent 7b30681227
commit 074b2f81b8
2 changed files with 6 additions and 13 deletions

View File

@@ -57,7 +57,7 @@
"eslint": "^4.6.0",
"eslint-find-rules": "^3.1.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.3.0",
"in-publish": "^2.0.0",
"react": ">= 0.13.0",
@@ -66,7 +66,7 @@
},
"peerDependencies": {
"eslint": "^4.6.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-react": "^7.3.0"
},

View File

@@ -13,7 +13,7 @@ module.exports = {
rules: {
// Enforce that anchors have content
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md
'jsx-a11y/anchor-has-content': ['error', { components: [''] }],
'jsx-a11y/anchor-has-content': ['error', { components: [] }],
// Require ARIA roles to be valid and non-abstract
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md
@@ -32,10 +32,6 @@ module.exports = {
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md
'jsx-a11y/aria-unsupported-elements': 'error',
// disallow href "#"
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/href-no-hash.md
'jsx-a11y/href-no-hash': ['error', { components: ['a'] }],
// Enforce that all elements that require alternative text have meaningful information
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md
'jsx-a11y/alt-text': ['error', {
@@ -55,9 +51,8 @@ module.exports = {
'jsx-a11y/label-has-for': ['error', { components: ['label'] }],
// require that mouseover/out come with focus/blur, for keyboard-only users
// 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': 'off',
'jsx-a11y/mouse-events-have-key-events': 'error',
// Prevent use of `accessKey`
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md
@@ -109,8 +104,7 @@ module.exports = {
// require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md
// TODO: enable?
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/click-events-have-key-events': 'error',
// 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
@@ -191,8 +185,7 @@ module.exports = {
// ensure <a> tags are valid
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/0745af376cdc8686d85a361ce36952b1fb1ccf6e/docs/rules/anchor-is-valid.md
// TODO: enable, semver-major
'jsx-a11y/anchor-is-valid': ['off', {
'jsx-a11y/anchor-is-valid': ['error', {
components: ['Link'],
specialLink: [],
aspects: ['noHref', 'invalidHref', 'preferButton'],