question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

visual studio code eslint support

See original GitHub issue

Description

The docs here https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md mention that vs code should support the eslint config without doing anything extra

VS Code ESLint plugin automatically detects Create React App's configuration file. So you do not need to create eslintrc.json at the root directory, except when you want to add your own rules. In that case, you should include CRA's config by adding this line:

in practice, with latest versions of everything, i still had to add .eslintrc containing { "extends": "react-app" } in order for the editor to load a config

Expected behavior

VS Code ESLint plugin automatically detects Create React App’s configuration file

Actual behavior

VS Code ESLint plugin needs and .eslintrc file to detect any config

Environment

Run these commands in the project folder and fill in their results:

npm ls react-scripts └── react-scripts@0.9.5 node -v v7.8.0 npm -v 4.2.0

  1. Operating system: macOS

I am not sure if this is a bug or a lack in documentation or I m just doing something wrong. If it’s the docs i can make a pull request I guess Cheers

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

31reactions
dbaeumercommented, Apr 27, 2017

Hi, I maintain the ESLint extension for VS Code and got here due to https://github.com/Microsoft/vscode-eslint/issues/230.

I created a react app using create-react-app my-app and the generated package.json file doesn’t contain an eslintConfig property. After adding

  "eslintConfig": {
    "extends": "react-app"
  }

things started to work for me. Is there something I am missing ?

10reactions
gaearoncommented, May 1, 2017

I don’t think we’ll be creating .eslintrc in the project folder, no. A property in package.json is a supported way to configure ESLint, so we would like to keep using that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code ESLint extension - Visual Studio Marketplace
Integrates ESLint into VS Code. If you are new to ESLint check the documentation. The extension uses the ESLint library installed in the ......
Read more >
How To Lint and Format Code with ESLint in Visual Studio Code
You can use a linter to do this. Linters check your code for syntax errors and highlight errors to make sure you can...
Read more >
How to use ESLint in VSCode - Robin Wieruch
ESLint supports you and teams to follow a common code style in your project. It can be used in VS Code by installing...
Read more >
ESLint + VSCode: How to Format Your Code Using .eslintrc
Open up VSCode's settings. On a Mac, press Cmd+, or get there through the menus: Code > Preferences > Settings. It'll open the...
Read more >
Setting up ESLINT in your JavaScript Project with VS Code
Eslint Vscode Setting up ESLINT in your JavaScript Project with VS Code · create a javascript project · install eslint as an extension...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found