Unverified Commit 89dd5c16 authored by Houssein Djirdeh's avatar Houssein Djirdeh Committed by GitHub

ESLint Config: Adds `alt` text rule for Image (#25462)

Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: 's avatarTim Neutkens <tim@timneutkens.nl>
parent 98905659
...@@ -12,10 +12,17 @@ module.exports = { ...@@ -12,10 +12,17 @@ module.exports = {
'plugin:react-hooks/recommended', 'plugin:react-hooks/recommended',
'plugin:@next/next/recommended', 'plugin:@next/next/recommended',
], ],
plugins: ['import', 'react'], plugins: ['import', 'react', 'jsx-a11y'],
rules: { rules: {
'import/no-anonymous-default-export': 'warn', 'import/no-anonymous-default-export': 'warn',
'react/react-in-jsx-scope': 'off', 'react/react-in-jsx-scope': 'off',
'jsx-a11y/alt-text': [
'warn',
{
elements: ['img'],
img: ['Image'],
},
],
}, },
parser: './parser.js', parser: './parser.js',
parserOptions: { parserOptions: {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"@typescript-eslint/parser": "^4.20.0", "@typescript-eslint/parser": "^4.20.0",
"eslint-import-resolver-node": "^0.3.4", "eslint-import-resolver-node": "^0.3.4",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.23.1", "eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4.2.0" "eslint-plugin-react-hooks": "^4.2.0"
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment