Closed Aplietexe closed 10 months ago
Does it work if you run npx eslint .
?
I'm assuming you don't have eslint as a top-level dependency, but eslint-config-hardcore is at the top level.
So next lint
ends up calling eslint somewhere deeper, like at node_modules/next/node_modules/eslint
, and it can't see node_modules/eslint-config-hardcore/
.
You should try to install eslint as a top-level dependency, and call it directly: eslint .
instead of next lint
.
npx eslint .
worked, and now pnpm lint
loads the config properly. I already had eslint
as a top-level dependency.
Must be that pnpm lint
/next lint
wasn't using the top-level eslint version. This might happen sometimes, when Next.js requires an older version of ESLint. In that case I recommend updating dependencies, including the deep ones (I usually do it via rm -rf node_modules package-lock.json && npm install
).
package.json
:Relevant
.eslintrc.cjs
:Upon running
pnpm lint
, I getReplacing
hardcore/ts
with./node_modules/eslint-config-hardcore/ts.json
works as a workaround.