When I upgraded to Next 14.1.0 from 13.3.1 I started getting a warning from yarn next build saying ESLint: Failed to load plugin 'jsx-a11y' declared in '.eslintrc.
This is the beginning of my eslintrc file:
{
"extends": ["airbnb", "airbnb-typescript", "prettier", "next/core-web-vitals"],
"plugins": ["prettier"],
"ignorePatterns": ["generated.ts"],
"rules": {
"prettier/prettier": "error",
"no-underscore-dangle": "off",
"react/jsx-filename-extension": [
1,
{
"extensions": [".ts", ".tsx"]
}
],
"react/function-component-definition": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["hrefLeft", "hrefRight"],
"aspects": ["invalidHref", "preferButton"]
}
],`
Jsx-a11y is a dependency of eslint-config-next 14.1.0:
eslint-config-next@^14.1.0:
version "14.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-14.1.0.tgz#7e309d426b8afacaba3b32fdbb02ba220b6d0a97"
integrity sha512-SBX2ed7DoRFXC6CQSLc/SbLY9Ut6HxNB2wPTcoIWjUMd7aF7O/SIE7111L8FdZ9TXsNV4pulUDnfthpyPtbFUg==
dependencies:
"@next/eslint-plugin-next" "14.1.0"
"@rushstack/eslint-patch" "^1.3.3"
"@typescript-eslint/parser" "^5.4.2 || ^6.0.0"
eslint-import-resolver-node "^0.3.6"
eslint-import-resolver-typescript "^3.5.2"
eslint-plugin-import "^2.28.1"
eslint-plugin-jsx-a11y "^6.7.1"
eslint-plugin-react "^7.33.2"
eslint-plugin-react-hooks "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705"
Don't get why it can't load the plugin? I've tried adding 'jsx-a11y' in my .eslintrc plugins, but get the same warning.