create-react-app: 'jsx-a11y/href-no-hash' was not found jsx-a11y/href-no-hash

Is this a bug report?

yes

Can you also reproduce the problem with npm 4.x?

yes

Environment

  1. node -v: 8.9.0
  2. npm -v: 5.5.1
  3. yarn --version (if you use Yarn): 1.3.2
  4. npm ls react-scripts (if you haven’t ejected): react-scripts@1.0.17

Then, specify:

  1. Operating system: mac os 10.13.1
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

  1. after update
  2. yarn start

Expected Behavior

No warnings!

Actual Behavior

after update to 1.0.17 warning in all file in project image @#image

Reproducible Demo

no

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

That’s the problem:


"eslint": "^4.10.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.7.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-prettier": "^2.2.0",
"eslint-plugin-react": "^7.4.0",

Using custom ESLint configs with CRA projects is not supported and is subject to issues like this. In particular, the difference in eslint-plugin-jsx-a11y versions is causing the trouble.

Of course if you eject you can customize anything you want.

But you can’t expect that you can take two arbitrary ESLint presets and use them together. If they rely on different versions of plugins, you need to either pick just one of them, or wait for them both to “line up”.

We try to keep up with the updates, but we don’t always match what Airbnb preset uses. If you ejected and prefer Airbnb’s preset, just remove ours.

They’re not suggestions, they’re requirements; indeed greenkeeper lacks proper peer dep support.

Adding npm ls to your tests will prevent greenkeeper from thinking invalid deps are passing.

For those of you not yet able to make it work, I added this on my .eslintrc https://github.com/mmazzarolo/eslint-plugin-react-app/blob/master/README.md#known-issues

Cheers 🤙🏻

when greenkeeper tells folks to update that package, everything breaks.

This sounds like an issue with greenkeeper to me. Out ESLint preset specifies a peer dependency on 5.x of the plugin. The update to 6.x is by definition unsafe if it breaks a peer dependency of a dependency.

eslint-config-react-app hasn’t released a new version

We actually did release it as part of the 2.x alpha. You can search issues for “2.x roadmap” and see the installation instructions there. The preset package has been published, it’s just not tagged as stable.

I really wish eslint-plugin-jsx-a11y could be a regular dependency of eslint-config-react-app

This doesn’t work in ESLint.

I’m confused, does this mean I can’t use eslint with CRA even if I execute it separately with a different config? I need eslint in all my projects for CI purposes and I would prefer not to be able to run a different version of it or at least have a different config using the same version of eslint. In my opinion, a boilerplate should not limit my ability to use a popular tool, and if there’s anything I can do to help I’d be happy to contribute.