Skip to content

Commit 074b2f8

Browse files
wyattdangerljharb
authored andcommitted
[eslint config] [breaking] [deps] Upgrade eslint-plugin-jsx-a11y to v6
- enable more a11y rules
1 parent 7b30681 commit 074b2f8

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

packages/eslint-config-airbnb/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"eslint": "^4.6.0",
5858
"eslint-find-rules": "^3.1.1",
5959
"eslint-plugin-import": "^2.7.0",
60-
"eslint-plugin-jsx-a11y": "^5.1.1",
60+
"eslint-plugin-jsx-a11y": "^6.0.2",
6161
"eslint-plugin-react": "^7.3.0",
6262
"in-publish": "^2.0.0",
6363
"react": ">= 0.13.0",
@@ -66,7 +66,7 @@
6666
},
6767
"peerDependencies": {
6868
"eslint": "^4.6.0",
69-
"eslint-plugin-jsx-a11y": "^5.1.1",
69+
"eslint-plugin-jsx-a11y": "^6.0.2",
7070
"eslint-plugin-import": "^2.7.0",
7171
"eslint-plugin-react": "^7.3.0"
7272
},

packages/eslint-config-airbnb/rules/react-a11y.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
rules: {
1414
// Enforce that anchors have content
1515
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md
16-
'jsx-a11y/anchor-has-content': ['error', { components: [''] }],
16+
'jsx-a11y/anchor-has-content': ['error', { components: [] }],
1717

1818
// Require ARIA roles to be valid and non-abstract
1919
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-role.md
@@ -32,10 +32,6 @@ module.exports = {
3232
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md
3333
'jsx-a11y/aria-unsupported-elements': 'error',
3434

35-
// disallow href "#"
36-
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/href-no-hash.md
37-
'jsx-a11y/href-no-hash': ['error', { components: ['a'] }],
38-
3935
// Enforce that all elements that require alternative text have meaningful information
4036
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/alt-text.md
4137
'jsx-a11y/alt-text': ['error', {
@@ -55,9 +51,8 @@ module.exports = {
5551
'jsx-a11y/label-has-for': ['error', { components: ['label'] }],
5652

5753
// require that mouseover/out come with focus/blur, for keyboard-only users
58-
// TODO: evaluate
5954
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md
60-
'jsx-a11y/mouse-events-have-key-events': 'off',
55+
'jsx-a11y/mouse-events-have-key-events': 'error',
6156

6257
// Prevent use of `accessKey`
6358
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md
@@ -109,8 +104,7 @@ module.exports = {
109104

110105
// require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress
111106
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md
112-
// TODO: enable?
113-
'jsx-a11y/click-events-have-key-events': 'off',
107+
'jsx-a11y/click-events-have-key-events': 'error',
114108

115109
// Enforce that DOM elements without semantic behavior not have interaction handlers
116110
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
@@ -191,8 +185,7 @@ module.exports = {
191185

192186
// ensure <a> tags are valid
193187
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/0745af376cdc8686d85a361ce36952b1fb1ccf6e/docs/rules/anchor-is-valid.md
194-
// TODO: enable, semver-major
195-
'jsx-a11y/anchor-is-valid': ['off', {
188+
'jsx-a11y/anchor-is-valid': ['error', {
196189
components: ['Link'],
197190
specialLink: [],
198191
aspects: ['noHref', 'invalidHref', 'preferButton'],

0 commit comments

Comments
 (0)