next-app-template icon indicating copy to clipboard operation
next-app-template copied to clipboard

Using Next.js default eslint rulesets (e.g. 'plugin:react-hooks/recommended')

Open jnachtigall opened this issue 1 year ago • 2 comments

Running npm run lint (just after cloning this repo) results in

⚠ The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/app/api-reference/config/eslint#migrating-existing-config

Is there a reason why the Mantine Next.js template does not use eslint-plugin-next or eslint-config-next ?

If this is deliberate then maybe disable the above warning - or add some information in the Readme.

I guess that extending from Next.js default eslint rules would benefit the user. For instance, I noticed that with the default eslint setup from this template 'plugin:react-hooks/recommended' does not show errors/warnings (maybe not included in Mantine preset?).

jnachtigall avatar Feb 25 '25 10:02 jnachtigall

eslint-plugin-next was not used because at the time of this repository development it was not compatible with ESLint 9. It might be compatible now, I did not check.

rtivital avatar Feb 25 '25 11:02 rtivital

I see. In the end it does not matter if the mantine ruleset is based on eslint-plugin-next as long as the number of eslint rules and settings is what you'd expect for a React/Next.js project. (Ok, maybe the warning is really misleading, too, then). But I just noticed that something is missing, because I did not get warnings for missing variables in the dependency arrays for useEffect or useCallback (which are from plugin:react-hooks/recommended).

Thanks for this template ❤ Saves a lot of time bootstrapping a project. Sorry, that I do not have time to contribute.

jnachtigall avatar Feb 27 '25 12:02 jnachtigall