Skip to content

Commit

Permalink
[dependency] - Add select eslint-plugin-jsx-a11y rules to lint config. (
Browse files Browse the repository at this point in the history
#175)

This project is a really good use case to apply some accessibility
rules to the lint config. For beginners getting started with React, we
can also teach/enforce basic accessibility rules in the web at author
time.

For now, I’ve just applied to the rules that are listed in
`eslint-config-airbnb` because these are most real-world tested, and we
can continue to add.

Happy to help if there are any questions/issues/concerns about the
plugin!
  • Loading branch information
beefancohen authored and gaearon committed Jul 25, 2016
1 parent 9dc23a3 commit 90d49f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
parser: 'babel-eslint',

// import plugin is termporarily disabled, scroll below to see why
plugins: ['react'/*, 'import'*/],
plugins: ['react'/*, 'import'*/, 'jsx-a11y'],

env: {
es6: true,
Expand Down Expand Up @@ -191,6 +191,12 @@ module.exports = {
'react/no-direct-mutation-state': WARNING,
'react/no-is-mounted': WARNING,
'react/react-in-jsx-scope': WARNING,
'react/require-render-return': WARNING
'react/require-render-return': WARNING,

// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
'jsx-a11y/aria-role': WARNING,
'jsx-a11y/img-has-alt': WARNING,
'jsx-a11y/img-redundant-alt': WARNING,
'jsx-a11y/no-access-key': WARNING
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"eslint": "3.1.1",
"eslint-loader": "1.4.1",
"eslint-plugin-import": "1.10.3",
"eslint-plugin-jsx-a11y": "2.0.1",
"eslint-plugin-react": "5.2.2",
"extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.9.0",
Expand Down

0 comments on commit 90d49f8

Please sign in to comment.