How can I use the new ESLint flat config in a Next.js project and also use 'canonical' rules? #50453
Replies: 2 comments
-
I really need an answer to this as well. After updating eslint config to flat format, eslint needs it to be in an eslint.config.js file for eslint to be happy with the flat format. However, next.js (when you run next lint) is looking for an eslintrc.json file, which is no longer valid with eslint flat config. So, how do we get next to look at a different config file?? I can't find the solution to that anywhere If we do get next to find the file, will it even be compatible with flat config? |
Beta Was this translation helpful? Give feedback.
-
Not sure if you found an answer but Eslint has this package: @eslint/compat that can be helpful |
Beta Was this translation helpful? Give feedback.
-
Summary
I have a TypeScript Next.js project called K that uses the built-in Next.js ESLint rules + "extends" a 3rd-party package that includes rules from Canonical, etc.
I want to:
I've read:
But I've still been unable to figure out what to do.
Below is my
src/eslint.config.ts
which I transpile toeslint.config.js
.How would you accomplish what I'm trying to do? Thanks.
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions