Next.js Discord

Discord Forum

Next.js ESLint Config

Answered
Japanese cockle posted this in #help-forum
Open in Discord
Japanese cockleOP
Curious as if to I'm the only one experiencing this - just noticed that I'm not getting any lint errors/warnings with the default Next.js ESLint config in VSCode/Cursor (tried both)

Running pnpm run lint does return lint diagnostics, but the editor doesn't seem to reflect any of them. Interestingly enough, the same line of code does produce an in-editor diagnostic in a default Vite + React project

Am I missing something here?
Answered by Japanese cockle
Okay, I just had a crazy thought and confirmed that was indeed the issue

To your point, I never assumed there was anything wrong with the ESLint extension because I normally see errors in the 'Output' tab (e.g, prettier, Biome, etc) - I didn't see anything at all with this issue, however, I just found out that ESLint has a hidden 'Output' tab that I need to dig into and that's where I found out - it's crashing because of the next/core-web-vitals plugin

Not only that, found out this only happens with pnpm, it's a known issue and has been going for a while now 🫠 https://github.com/vercel/next.js/issues/78813
View full answer

12 Replies

Asian black bear
Have you installed the eslint extension in VSCode?
Japanese cockleOP
I have the ESLint extension, yes
@Japanese cockle I have the ESLint extension, yes
Chinese Alligator
Try restarting the extension?
Japanese cockleOP
I… Think I’m way past that point?

So as I mentioned, the ESLint in-editor diagnostics show up properly on a Vite project, and basically any other JS/TS project I have except the Next.js ones with base configuration
@Japanese cockle I… Think I’m way past that point? So as I mentioned, the ESLint in-editor diagnostics show up properly on a Vite project, and basically any other JS/TS project I have except the Next.js ones with base configuration
Chinese Alligator
Sometimes restarting the extension works and it never hurts to try 🙂

Is your eslint config under the workspace root folder?
Japanese cockleOP
It is, yes. The project I used to showcase was literally straight from create-next-app@latest, no adjustments
Alright, you up for an experiment? I think this will make things way easier

Steps to reproduce:
- Have either VSCode/Cursor with the ESLint extension
- Create a next app (select yes to everything)
- In app.tsx, create an unused variable
- Does the editor show an error?
- Does npm run lint throw an error?
Chinese Alligator
Just to be sure, my-app is the root folder and no folder is above it in the current workspace.
Japanese cockleOP
Yes, 100% sure
Japanese cockleOP
Okay, I just had a crazy thought and confirmed that was indeed the issue

To your point, I never assumed there was anything wrong with the ESLint extension because I normally see errors in the 'Output' tab (e.g, prettier, Biome, etc) - I didn't see anything at all with this issue, however, I just found out that ESLint has a hidden 'Output' tab that I need to dig into and that's where I found out - it's crashing because of the next/core-web-vitals plugin

Not only that, found out this only happens with pnpm, it's a known issue and has been going for a while now 🫠 https://github.com/vercel/next.js/issues/78813
Answer
Japanese cockleOP
I mainly use pnpm, I assume you use another package manager, so that explains why you were seeing nothing wrong with linting on your end