Skip to content
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

feat: migrate to ESM only #622

Merged
merged 2 commits into from
Mar 19, 2025
Merged

feat: migrate to ESM only #622

merged 2 commits into from
Mar 19, 2025

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Mar 19, 2025

All LTS versions of node will soon support require(esm) as 18.x will fall out of long term support imminently

ESLint 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 CommonJS in Node <20

Depends on #621 since this makes the lint rules apply again (they currently don't in main)

Moves the repo to be of `type: "module"` (i.e. ESM).

ESLint already uses a dynamic import to load plugins, so this will only
affect CommonJS users with flat config in Node <20.
@43081j 43081j requested a review from a team as a code owner March 19, 2025 12:51
@43081j 43081j requested a review from manuelpuyol March 19, 2025 12:51
Copy link
Member

@keithamus keithamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM.

@keithamus keithamus merged commit 139bf63 into github:main Mar 19, 2025
2 checks passed
@@ -0,0 +1,5 @@
const svgElementAttributes = require('svg-element-attributes')
Copy link
Contributor Author

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 an import , we need to use import attributes (node 20)

One day when we bump the minimum node version, we should move this back into esm

@43081j 43081j deleted the esm-only branch March 19, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants