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

Update to ES modules #38

Closed
robatwilliams opened this issue Jan 14, 2022 · 6 comments · Fixed by #103
Closed

Update to ES modules #38

robatwilliams opened this issue Jan 14, 2022 · 6 comments · Fixed by #103

Comments

@robatwilliams
Copy link
Owner

robatwilliams commented Jan 14, 2022

Update the code of the plugin itself to use import and export rather than require and module.exports.

Update the lint rules in eslintrc to require this style, and prohibit CommonJS style.

@robatwilliams robatwilliams added the modernise Needs doing for evergreenness label Jan 14, 2022
@robatwilliams robatwilliams added good first issue Good for newcomers and removed modernise Needs doing for evergreenness labels May 5, 2023
@robatwilliams
Copy link
Owner Author

Runs into problem
mysticatea/eslint-plugin-node#349

Could disable that rule, and rely on CI unit tests to catch e.g. Node 14 issues. But currently that doesn't cover the check-es-compat utility.

@robatwilliams
Copy link
Owner Author

robatwilliams commented May 12, 2023

Disable the rule, and use es-compat itself to check compatibility of its own source code? (!) But that would be disconnected from package.json:engines

@robatwilliams
Copy link
Owner Author

Need to switch to https://github.com/eslint-community/eslint-plugin-n because the author (same one as eslint-plugin-es) has also abandoned his node plugin

@robatwilliams
Copy link
Owner Author

Blocked on Jest ESM support - https://jestjs.io/docs/ecmascript-modules

@robatwilliams
Copy link
Owner Author

robatwilliams commented May 12, 2023

to do as part of this eventually:

  • remove mjs extension and references to it
  • type:module in package.jsons
  • import/newline-after-import instead of custom spacing lint rule
  • file extensions are required with ES modules
  • enable specific recommended config plugin:n/recommended-module
  • sourceType=module in parser options
  • enable eslint import plugin /recommended

@robatwilliams robatwilliams added blocked This cannot be worked on until something external happens and removed good first issue Good for newcomers labels May 12, 2023
@robatwilliams
Copy link
Owner Author

Also see this about importing browser compat data https://github.com/mdn/browser-compat-data/releases/tag/v5.0.0

@robatwilliams robatwilliams removed the blocked This cannot be worked on until something external happens label Jan 30, 2024
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 a pull request may close this issue.

1 participant