diff --git a/.eslintrc.js b/.eslintrc.js index e9e85b22..f14066a0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,6 +8,7 @@ module.exports = { 'eslint:recommended', 'plugin:react/recommended', 'plugin:@next/next/recommended', + 'plugin:jsx-a11y/strict', ], parserOptions: { ecmaFeatures: { @@ -16,7 +17,11 @@ module.exports = { sourceType: 'module', }, ignorePatterns: ['/build/*'], - plugins: ['react', 'import'], + plugins: [ + 'react', + 'import', + 'jsx-a11y', + ], settings: { react: { version: 'detect', @@ -106,5 +111,14 @@ module.exports = { // Are you sure | is not a typo for || ? 'no-bitwise': ['error'], + + // bandaid fix; see the following github issues + // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/402 + // https://github.com/vercel/next.js/issues/5533 + 'jsx-a11y/anchor-is-valid': [ 'error', { + components: [ 'Link' ], + specialLink: [ 'hrefLeft', 'hrefRight' ], + aspects: [ 'invalidHref', 'preferButton' ], + }], }, }; diff --git a/components/Navbar.js b/components/Navbar.js index 74199fbb..7c323822 100644 --- a/components/Navbar.js +++ b/components/Navbar.js @@ -77,6 +77,8 @@ export default class Navbar extends React.Component {
+ {/* TODO: resolve this by refactoring the navbar */} + {/* eslint-disable-next-line jsx-a11y/label-has-for */}