"Displaying Lint Output in the Editor" instructions not working in VS Code
See original GitHub issueDescription
The “Displaying Lint Output in the Editor” instructions do not work for VS Code.
Expected behavior
I expect my editor to show linting warnings and errors.
Actual behavior
ESLint is unable to load.
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected): This is coming back empty…node -v
: 6.5.0npm -v
: 3.10.3
Then, specify:
- Operating system: macOS
- Browser and version: N/A
- VS Code version: 1.5.3
Reproducible Demo
My working version of @wesbos’s React for Beginners project. I did change the value of eslintConfig.extends
in package.json
like the instructions state. Pull from c55d10ae48718695a0fca61b0981c8a4974ea92f
to get a state where ESLint didn’t work.
Workaround
I got ESLint to work in VS Code by adding all of the dependencies (including eslint@3.5.0) as local dev dependencies to my project.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Linting Python in Visual Studio Code
To perform linting, open the Command Palette (Ctrl+Shift+P), filter on "linting", and select Python: Run Linting. Linting will run automatically when you save...
Read more >ESLint not working in VSCode? Help build a troubleshooting ...
Open the command palette by pressing Ctrl / Cmd + Shift + P and select 'ESLint: Show Output Channel '. If ESLint throws...
Read more >ESLint not working in VS Code? - Stack Overflow
To verify, press Ctrl + Shift + U in VSCode to open the Output panel after opening a JavaScript file with a known...
Read more >How To Lint and Format Code with ESLint in Visual Studio Code
To find the settings in Visual Studio Code, use the command palette to open Preferences: Open Workspace Settings (JSON). With this code in...
Read more >Advanced Visual Studio Code for Python Developers
To assign that shortcut to only work when you're editing Python code, ... The -q flag is a Python command-line flag to stop...
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
Hey @gaearon and @martellaj , to get linting working in VSCode, you need 4 things:
Have eslint plugin for VSCode
npm i -g eslint
A
.eslintrc.js
like this, in your project root:Have npm@3 and run
npm i
in your project.4 is needed as
create-react-app
seems to only install npm@2 style deps, but for VSCode’s eslint plugin to worknode_modules/eslint-config-react-app
needs to be present. Currently it’s atnode_modules/react-scripts/node_modules/eslint-config-react-app
.I’m wondering if I can let
create-react-app
use npm@3 style deps (or yarn).EsLint in VS Code is looking for
.eslintrc.json
, so to remove errors messages just add that to your root: