Configuration for rule "jsx-a11y/anchor-has-content" is invalid:
Value "" is the wrong type.
Referenced from: airbnb
Any ideas? Thanks
I'm getting the same error with npm run lint. I assume it's due to the version published on npm being out of date. The latest version here on GitHub is v3.0.1, but on npm it's only v2.2.3.
Update: This actually seems to be breaking because eslint-config-airbnb v13.0.0 relies on the API of eslint-plugin-jsx-a11y v2.2.3, which changed as of the latest v3.0.1 release. Reverting to eslint-plugin-jsx-a11y v2.2.3 fixed the issue for me. The real fix will need to be made in eslint-config-airbnb.
I have solved cleaning cache in npm and don't using yarn
@cooperka the real fix is using the install command in the airbnb package's readme, so that you have the proper peer deps, instead of blindly upgrading. npm ls would have told you that v3 of this package was incompatible.
Yes, exactly, this one:
(
export PKG=eslint-config-airbnb;
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)
Thanks @ljharb, that works great! I checked the release notes before upgrading to v13 of course, but unfortunately there were none, so I had no idea I was supposed to run that command. Cheers!
@cooperka the release notes for any repo are always in a changelog file - the page on Github is never guaranteed to be filled out for any repo. https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/CHANGELOG.md and https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/CHANGELOG.md are the relevant ones.
Most helpful comment
I'm getting the same error with
npm run lint.I assume it's due to the version published on npm being out of date. The latest version here on GitHub is v3.0.1, but on npm it's only v2.2.3.Update: This actually seems to be breaking because
eslint-config-airbnb v13.0.0relies on the API ofeslint-plugin-jsx-a11y v2.2.3, which changed as of the latest v3.0.1 release. Reverting toeslint-plugin-jsx-a11y v2.2.3fixed the issue for me. The real fix will need to be made ineslint-config-airbnb.