create-react-app: Not compatible with VS Code + ESLint plugin

Perhaps this is an issue not in the scope of this project but…

Steps

  1. $ create-react-app testApp && cd testApp
  2. Open project in VS Code with ESLint plugin installed
  3. Open any javascript file

Expected

ESLint plugin lints my code and displays errors.

Actual

VS Code display this error: No ESLint configuration found


This makes sense because there isn’t an eslint config file anywhere. I ran npm run eject and changed config/eslint.js to config/.eslintrc.js to match '**/.eslintr{c.js,c.yaml,c.yml,c,c.json}' per https://github.com/Microsoft/vscode-eslint/blob/master/eslint/extension.ts#L40. This didn’t fix the issue. Does anyone have any suggestions?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (13 by maintainers)

Most upvoted comments

Ideally I’d like different tools to adopt a convention of configuration field in package.json that would specify base directory for all configs. We would just put react-scripts/config there, and Flow and ESLint could autodiscover them there. Tools don’t currently support this because zero conf environments are rare in JS.

Please follow these instructions for integrating linting with your editor:

https://github.com/facebookincubator/create-react-app/blob/master/template/README.md#display-lint-output-in-the-editor

It is unfortunate that we require global installation but this is a problem on ESLint’s end, and they intend to solve it: https://github.com/eslint/eslint/issues/3458.