Skip to content

Commit

Permalink
ESLint Config: Adds alt text rule for Image (#25462)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
  • Loading branch information
3 people committed Jun 1, 2021
1 parent 9890565 commit 89dd5c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/eslint-config-next/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ module.exports = {
'plugin:react-hooks/recommended',
'plugin:@next/next/recommended',
],
plugins: ['import', 'react'],
plugins: ['import', 'react', 'jsx-a11y'],
rules: {
'import/no-anonymous-default-export': 'warn',
'react/react-in-jsx-scope': 'off',
'jsx-a11y/alt-text': [
'warn',
{
elements: ['img'],
img: ['Image'],
},
],
},
parser: './parser.js',
parserOptions: {
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@typescript-eslint/parser": "^4.20.0",
"eslint-import-resolver-node": "^0.3.4",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4.2.0"
},
Expand Down

0 comments on commit 89dd5c1

Please sign in to comment.