next lint not working
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
0 verbose cli /home/lance/.nvm/versions/node/v14.19.1/bin/node /home/lance/.nvm/versions/node/v14.19.1/lib/node_modules/npm/bin/npm-cli.js 1 info using npm@8.10.0 2 info using node@v14.19.1 3 timing npm:load:whichnode Completed in 1ms 4 timing config:load:defaults Completed in 3ms 5 timing config:load:file:/home/lance/.nvm/versions/node/v14.19.1/lib/node_modules/npm/npmrc Completed in 16ms 6 timing config:load:builtin Completed in 16ms 7 timing config:load:cli Completed in 3ms 8 timing config:load:env Completed in 0ms 9 timing config:load:file:/home/lance/nextjs-eslint/.npmrc Completed in 0ms 10 timing config:load:project Completed in 2ms 11 timing config:load:file:/home/lance/.npmrc Completed in 0ms 12 timing config:load:user Completed in 0ms 13 timing config:load:file:/home/lance/.nvm/versions/node/v14.19.1/etc/npmrc Completed in 0ms 14 timing config:load:global Completed in 0ms 15 timing config:load:validate Completed in 0ms 16 timing config:load:credentials Completed in 1ms 17 timing config:load:setEnvs Completed in 1ms 18 timing config:load Completed in 27ms 19 timing npm:load:configload Completed in 28ms 20 timing npm:load:mkdirpcache Completed in 1ms 21 timing npm:load:mkdirplogs Completed in 1ms 22 verbose title npm exec next info 23 verbose argv “exec” “–yes” “false” “–” “next” “info” 24 timing npm:load:setTitle Completed in 1ms 25 timing config:load:flatten Completed in 2ms 26 timing npm:load:display Completed in 4ms 27 verbose logfile logs-max:10 dir:/home/lance/.npm/_logs 28 verbose logfile /home/lance/.npm/_logs/2022-06-29T03_40_33_537Z-debug-0.log 29 timing npm:load:logFile Completed in 5ms 30 timing npm:load:timers Completed in 0ms 31 timing npm:load:configScope Completed in 0ms 32 timing npm:load Completed in 42ms 33 silly logfile start cleaning logs, removing 1 files 34 silly logfile done cleaning log files 35 timing arborist:ctor Completed in 2ms 36 http fetch GET 200 https://registry.npmjs.org/next 23586ms (cache miss) 37 timing arborist:ctor Completed in 0ms 38 timing command:exec Completed in 23756ms 39 verbose stack Error: canceled 39 verbose stack at exec (/home/lance/.nvm/versions/node/v14.19.1/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:177:17) 39 verbose stack at async module.exports (/home/lance/.nvm/versions/node/v14.19.1/lib/node_modules/npm/lib/cli.js:78:5) 40 verbose cwd /home/lance/nextjs-eslint 41 verbose Linux 5.13.0-51-generic 42 verbose node v14.19.1 43 verbose npm v8.10.0 44 error canceled 45 verbose exit 1 46 timing npm Completed in 24817ms 47 verbose code 1 48 error A complete log of this run can be found in: 48 error /home/lance/.npm/_logs/2022-06-29T03_40_33_537Z-debug-0.log
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I’m confused as to why there is a next lint command if it does not work. Running yarn lint shows no errors but yarn build shows errors and can also see errors in vscode and the browser.
Expected Behavior
running lint script should show errors
Link to reproduction
https://github.com/laclance/nextjs-eslint
To Reproduce
yarn && yarn lint
Issue Analytics
- State:
- Created a year ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
OK thanks @balazsorban44 I am using @typescript-eslint/recommended and was still not seeing errors, however errors starting appearing again and I didn’t change anything so I don’t know what went wrong.
I looked at the OP’s reproduction, and I could not find an issue. Our default
next/core-web-vitals
is supposed to catch Next.js related issues, if you want to warn about unused variables, you can try extending your ESLint configuration, eg.:Please see the docs: https://nextjs.org/docs/basic-features/eslint#additional-configurations
@cnotethegr8 from our docs:
So in your case, since you put the error in the
temp
folder, you need to add it todirs
like so:https://nextjs.org/docs/basic-features/eslint#linting-custom-directories-and-files
(@mlarcher without seeing a reproduction, I’m just guessing you have a similar issue to one of these above)
So I’m closing this as it works as intended, thanks!