Installing eslint in a fresh app should give an error
See original GitHub issueIs this a bug report?
I think so, but I’m not sure.
Did you try recovering your dependencies?
Yes, I did.
$ npm --version
6.4.1
Which terms did you search for in User Guide?
eslint
Environment
Environment:
OS: Windows 10
Node: 10.10.0
Yarn:
npm: 6.4.1
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.5.2 => 16.5.2
react-dom: ^16.5.2 => 16.5.2
react-scripts: 1.1.5 => 1.1.5
Steps to Reproduce
- npm init react-app my-app
- cd my-app
- npm install eslint --save-dev
Expected Behavior
Eslint should install with the lastest version (currently 5.6.1) without problems and it should show no warnings during installation.
Actual Behavior
Several npm warnings are shown stating that an older version of eslint should be installed by me as it is a peer dependency of several packages which were automatically installed with eslint.
$ npm install eslint --save-dev
npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint@^4.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-loader@1.9.0 requires a peer of eslint@>=1.6.0 <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-import@2.8.0 requires a peer of eslint@2.x - 4.x but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-jsx-a11y@5.1.1 requires a peer of eslint@^2.10.2 || ^3 || ^4 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react@7.4.0 requires a peer of eslint@^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ eslint@5.6.1
added 30 packages from 33 contributors, updated 6 packages, moved 1 package and audited 14759 packages in 10.093s
found 0 vulnerabilities
Reproducible Demo
Not available.
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
Getting Started with ESLint - Pluggable JavaScript Linter
You can install and configure ESLint using this command: ... The three error levels allow you fine-grained control over how ESLint applies rules...
Read more >error - ESLint must be installed: yarn add --dev eslint
I just created a new project using
Read more >Using ESLint to detect errors in NodeJS applications
ESLint is a customizable plugin that corrects your JavaScript and can give you errors or even just suggestions to do better code.
Read more >Adding ESlint to Your Project - Medium
In this article I will help you to add ESlint to an existing or a new project with a couple of easy steps...
Read more >Troubleshooting a Next.js app with ESLint - LogRocket Blog
Setting up ESLint with Next.js. Inside your Next.js app, add a new script called lint — its value should be next lint :...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FYI,
npm start
works without problems after installing an older version of ESLint by my own and using the snippet above in my.eslintrc
.Anyway, I understand from your comments @gaearon and @bugzpodder that the preferred route in my case would be to keep using the ESLint version that comes with create-react-app (now that I know that!) and have the plugin simply be upgraded to support it.
Thanks for your comments.
The only real issue here would be then a documentation one to make more clear:
Well, supposing that I managed to have the ESLint plugin [^1] to work with the last version of ESLint, I understand that these two steps would suffice:
npm install eslint-config-techchange --save-dev
.eslintrc
:I’ll try it and I’ll let you know.
[^1]: To be more specific, in my case this is a Shareable ESLint Config, not an plugin.