Next.js Discord

Discord Forum

What's a valid lint command for a NextJS project?

Answered
Griffon Nivernais posted this in #help-forum
Open in Discord
Griffon NivernaisOP
At the moment I ended up with eslint . && tsc due to next lint originally not picking up my ESLint, but I think it was a skill issue honestly and wanted to know if next lint alone will do the same things, or if say next lint && tsc is necessary.
Answered by linesofcode
@Griffon Nivernais unless explicitly disabled in the next config, nextjs will always run tsc as part of the build process and fail your builds if there are errors
View full answer

8 Replies

@Griffon Nivernais unless explicitly disabled in the next config, nextjs will always run tsc as part of the build process and fail your builds if there are errors
Answer
I also use eslint directly instead of next lint
since i have extra configs it doesnt pick up (but maybe that may have been a config issue on my behalf)
running tsc isn't something i typically do during lint since those errors would be caught during build, but thats subjective
@linesofcode running tsc isn't something i typically do during lint since those errors would be caught during build, but thats subjective
Griffon NivernaisOP
I prefer building to be the final stage after linting greenlights me, though it's nice to have that safety net in the beginning.
I'll probably end up sticking with ESLint + TSC for linting, is there a reason why you prefer ESLint over next lint?
I extend the default lint rules next provided with other ones
@linesofcode I extend the default lint rules next provided with other ones
Griffon NivernaisOP
That makes sense, I do the same thing so I'll stick with ESLint + TSC then. Thank you so much! 💞