6

In VS Code I get a lot of lint errors, but they do not refresh after fix. If you look in image I removed line 16 but it still appears.

Is this a bug in VS Code or how do these get removed?

enter image description here Do I have to restart VS Code?

Alex Wayne
  • 178,991
  • 47
  • 309
  • 337
Thomas Segato
  • 4,567
  • 11
  • 55
  • 104

3 Answers3

21

The accepted answer here is real bad, there's no actual explaination.

For ESLint: I pull this from this thread https://github.com/microsoft/vscode-eslint/issues/477

To fix this you need to restart the lint server:

  1. Use CTRL + SHIFT + P
  2. Look for: ESLint: Restart ESLint Server

For TSLint: VSCode needs to be restarted after modifying tsconfig and tslint files in nrwl nx projects to eliminate errors (not sure why the answer got a -1 as this seems to be viable. If anyone knows please let me know!)

  1. Use CTRL + SHIFT + P
  2. Look for: Restart TS Server
Damian Green
  • 6,895
  • 2
  • 31
  • 43
Kris Boyd
  • 798
  • 10
  • 17
  • 1
    This also works for searching and restarting black, flake8, and the python language server - so super handy, thanks! – LSgeo Jul 19 '23 at 07:23
0

Linter messages generated in the terminal by build tools and compilers are completely separate from the real time linting generated by extensions and shown in the VS code problems pane.

The latter will disappear automatically upon fix, but the former will only change once you rebuild or recompile.

ultraGentle
  • 5,084
  • 1
  • 19
  • 45
0

You can restart the lint server in VS Code.

ywang1724
  • 845
  • 6
  • 13