- Notifications
You must be signed in to change notification settings - Fork59
feat: migrate to ESM only#622
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Moves the repo to be of `type: "module"` (i.e. ESM).ESLint already uses a dynamic import to load plugins, so this will onlyaffect CommonJS users with flat config in Node <20.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This LGTM.
139bf63
intogithub:mainUh oh!
There was an error while loading.Please reload this page.
@@ -0,0 +1,5 @@ | |||
const svgElementAttributes = require('svg-element-attributes') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This file is unfortunate but we have to jump back into cjs in order to load these two JSON files
If we use animport
, we need to use import attributes (node 20)
One day when we bump the minimum node version, we should move this back into esm
All LTS versions of node will soon support
require(esm)
as18.x
will fall out of long term support imminentlyESLint also already loads plugins via a dynamic import, so if we make this change it means the only people affected are those writing flat configs as CommonJSin Node <20
Depends on#621 since this makes the lint rules apply again (they currently don't in main)