Next.js Discord

Discord Forum

Get `next lint` to show issues in VSCode Problems tab?

Unanswered
Joe Pea posted this in #help-forum
Open in Discord
How do we get next lint results to show in VSCode's Problems tab?

10 Replies

@Joe Pea How do we get `next lint` results to show in VSCode's Problems tab?
install the eslint extension of vscode
@Yi Lon Ma install the `eslint` extension of vscode
That doesn't make all problems across the project appear in Problems tab, it only shows problems for the currently open files.
If I have only one file open i still want to see aaaaall problems.

With TypeScript we can run TSC via vscode tasks and this will show project-wide problems in the Problems tab for example
Asian black bear
The eslint plugin doesn't support this and you have to use a custom task for it.
It also makes sense that it's not supported. You really don't want to rerun eslint across you entire app on each change, especially in a monorepo.
Even more so nowadays that eslint has become excruciatingly slow.
I imagine it would run on all files initially, then only on files that changed (except for with plugins like TS linting that need cross file context)
Asian black bear
Caching is difficult and so many rules cause inconsistent output that it often is not worth the effort.
Another aspect to keep in mind is that you can easily reach a state with deteriorated DX. When I’m expanding a feature I know that my code will be incorrect or cause linting errors. Having my machine slow down to lint everything while I’m iterating is a bad experience when the only moment it matters is a merge into the main branch and maybe on push unless it’s a WIP push.
This is also one of the reasons why the dev server doesn’t perform type checking. You typically only care that it’s correct at the end.