Eslint-plugin-jsx-a11y: Error in Atom opening .js file

Created on 7 Nov 2016  路  6Comments  路  Source: jsx-eslint/eslint-plugin-jsx-a11y

Configuration for rule "jsx-a11y/anchor-has-content" is invalid:
Value "" is the wrong type.
Referenced from: airbnb

Any ideas? Thanks

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.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.

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings