Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overrides warnings not showing in problems pane #1059

Closed
mcchong opened this issue Aug 31, 2020 · 14 comments
Closed

Overrides warnings not showing in problems pane #1059

mcchong opened this issue Aug 31, 2020 · 14 comments
Labels
info-needed Issue requires more information from poster

Comments

@mcchong
Copy link

mcchong commented Aug 31, 2020

I am migrating from a javascript project to typescript, and have set up a eslintrc.yml file with the following overrides:

  - files:
      - "*.ts"
      - "*.tsx"
    parser: "@typescript-eslint/parser"
    extends: 
      - plugin:@typescript-eslint/recommended

However, the warnings emitted by that overrides (which appear when building in the terminal) do not show in the problems pane. I can't figure how to enable them so I think this is a bug.

Some more details:

  • lint task is enabled
  • I can see warnings from eslint from other rules in the "Problems" tab
  • I can modify my eslintrc.yml file and disable and enable other rules
  • The rules from the overrides item above are not visible in the problems tab, but visible when compiling other ways (e.g. running the build task).
@dbaeumer
Copy link
Member

dbaeumer commented Sep 1, 2020

Please see https://github.com/microsoft/vscode-eslint#settings-options especially the setting eslint.lintTask.enable.

Please ping if this doesn't address your problem.

@dbaeumer
Copy link
Member

dbaeumer commented Sep 1, 2020

Just to be clear: you need to run the task to get problems for all files using the Run Task command in VS Code.

@mcchong
Copy link
Author

mcchong commented Sep 1, 2020

Sorry, updating my description for clarity:

  • lint task is enabled
  • I can see warnings from eslint from other rules in the "Problems" tab
  • I can modify my eslintrc.yml file and disable and enable other rules
  • The rules from the overrides item above are not visible in the problems tab, but visible when compiling other ways (e.g. running the build task).

@dbaeumer
Copy link
Member

dbaeumer commented Sep 2, 2020

@mcchong can you provide me with a GitHub repository I can clone that demos that.

@mcchong
Copy link
Author

mcchong commented Sep 25, 2020

@mcchong
Copy link
Author

mcchong commented Sep 25, 2020

Specifically, looking at DemoComponent.tsx vs ImageCompressor.jsx

Building with "npm run build" or the build task emits 2 linter warnings, one for the jsx file on line 64, and one for the tsx file on line 8.
In the "Problems" pane, with both files open, I only see the warning for the issue in the jsx file.

@dbaeumer
Copy link
Member

@mcchong I can not reproduce this. Running in the terminal gives:

capture

@dbaeumer
Copy link
Member

There is no file DemoComponent.tsx in the repository.

@mcchong
Copy link
Author

mcchong commented Sep 28, 2020

Try cloning from here https://github.com/mcchong/react-image-compressor.git ? It's the forked repository under my account, master branch. The latest commit should be d785f00949794c1a80278112b2806939e26c9a6c, and DemoComponent.tsx is in src/components. I just tried cloning it myself and was able to reproduce..

@mcchong
Copy link
Author

mcchong commented Sep 28, 2020

But running react-scripts build gives me different errors than ./node_modules/.bin/eslint .... Am I missing some config then?

@dbaeumer
Copy link
Member

Yes, I guess react-scripts build will run with different ESLint settings. You need to look into these script to find out which settings they use from where. The ESLint extension uses the same settings as the eslint command in the terminal.

Let me know if you need further help.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Sep 29, 2020
@mcchong
Copy link
Author

mcchong commented Sep 29, 2020

Were you able to reproduce the issue from the repo above? Both scripts seem to be using my .eslintrc file, but the eslint command seems to be missing some rules.

@mcchong
Copy link
Author

mcchong commented Sep 29, 2020

Okay figured it out. There is an "eslintConfig" option in the package json that webpack uses that I didn't see. I made that consistent with the .eslintrc. Thanks for the tips.

@mcchong mcchong closed this as completed Sep 29, 2020
@mcchong
Copy link
Author

mcchong commented Oct 23, 2020

For anyone running into similar issues it looks like the issue is actually on react-scripts side:
facebook/create-react-app#8849
facebook/create-react-app#9083

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants