-
Notifications
You must be signed in to change notification settings - Fork 28.3k
feat(eslint-plugin-next
): Support flat config, ship with types, and export in both ESM & CJS formats
#76935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: canary
Are you sure you want to change the base?
feat(eslint-plugin-next
): Support flat config, ship with types, and export in both ESM & CJS formats
#76935
Conversation
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
Aw shit. I thought I searched, but not well enough apparently. That PR's a nice, minimal solution. I don't believe it will fix the types issue, however. I'm happy to fast follow with that upgrade separately when it gets merged. |
Until this PR gets merged (or another much better PR), I published a fork of this plugin for my own use. I thought someone else might find it useful. It supports TypeScript, ESM, and ESLint v9 with a single config (all rules on as warnings). https://www.npmjs.com/package/eslint-plugin-nextjs
|
cc @devjiwonchoi would be super nice to get flat config support ASAP |
Hi, this is a breaking change and would require us to publish on v16. Does #73873 not resolve the use case for flat config ATM? |
@devjiwonchoi I think it does, yes. That PR provides a proper flat config without much fuss. It doesn't ship the plugin with types, but that could be added with the config as it is now. I would close my PR, and I'll try to find time to resubmit one that just provides types. |
I still a problems with 15.3.1 |
Description
eslint-plugin-next
doesn't support the ESLint flat config. In this PR, I refactor the plugin to ship with types out of the box, support both legacy and flat config, and support ESM and CJS. This plugin is currently being used via some "compat" utils. This upgrade improves everyone's DX while still maintaining backward compatibility.To approach the conversion, I first let Claude have a go at it, but I didn't like the direction it was going. So I based most of this on
eslint-plugin-perfectionist
, which does a great job of support legacy/flat configs with minimal code repetition.Changes Made
any
everywhere else. It's not ideal, but I didn't want to risk changing functionality. This essentially just explicitly acknowledges existing behavior.tsup
for the build. I tried usingswc
, buttsup
makes it 10x easier to export types, ESM, and CJS all at once.Issues Resolved
The Next.js plugin was not detected
reporting when using flat config #73655TODO list
eslint-config-next
to flat configcreate-next-app
with the changes