belgattitude / nextjs-monorepo-example

Collection of monorepo tips & tricks
MIT License
1.58k stars 212 forks source link

Upgrade eslint to V9 and typescript-eslint v7 #5086

Open tianyingchun opened 6 months ago

tianyingchun commented 6 months ago

upgrade eslint typescript to https://typescript-eslint.io/blog/announcing-typescript-eslint-v7

belgattitude commented 6 months ago

Thanks @tianyingchun It's actually updated, see https://github.com/belgattitude/nextjs-monorepo-example/blob/main/packages/eslint-config-bases/package.json

But be aware than it might cause issues, I'm tracking it down in an another repo https://github.com/belgattitude/shared-dx/pull/539

The idea is to first allow https://github.com/vercel/next.js/blob/dd24033caf1cfcfc3f9efde925bf54132e4d322c/packages/eslint-config-next/package.json#L15C35-L15C51

tianyingchun commented 6 months ago

we don't use typescript-eslint package directly?

belgattitude commented 6 months ago

I think this will answer your question

tianyingchun commented 6 months ago

typescript-eslint has dependencies

  "dependencies": {
    "@typescript-eslint/eslint-plugin": "7.0.1",
    "@typescript-eslint/parser": "7.0.1"
  },

https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/package.json#L56

belgattitude commented 6 months ago

Yes... you're well talking about this repo ?

it's on v7: https://github.com/belgattitude/nextjs-monorepo-example/blob/091ae3bbc29ea8e3141a8bea7cc45cf711b59398/packages/eslint-config-bases/package.json#L70

The warning I mentionned is that it will cause issues till other plugins allows it at v7 too. See above.

Would suggest to play with yarn why -R @typescript-eslint/parser to understand the side-effects. A major must be allowed by all other plugins, otherwise the hoisting will possibly lead to eslint 'cannot ... uniquely'... this won't happens with eslint flat config, but not yet ready in the ecosystem

tianyingchun commented 6 months ago

yes, agree :) maybe we need to wait the eslint related plugins upgrade to support V7

tianyingchun commented 4 months ago

eslint V9 now released, will eslint-config-bases updated ?

belgattitude commented 4 months ago

I’ll wait till nextjs supports it. Feel free to open a pr too. Might help to discover issues as well.

belgattitude commented 4 months ago

Btw the pr https://github.com/vercel/next.js/pull/62137 landed in nextjs 14.2.0

belgattitude commented 4 months ago

To keep reference:

tianyingchun commented 4 months ago

waiting few month later maybe :)

tianyingchun commented 3 months ago

https://github.com/ArnaudBarre/eslint-plugin-react-refresh if we need to include eslint-plugin-react-refresh