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(eslint/esm): enable more ESM rules #763

Merged
merged 1 commit into from
Oct 5, 2023
Merged

feat(eslint/esm): enable more ESM rules #763

merged 1 commit into from
Oct 5, 2023

Conversation

kanadgupta
Copy link
Member

🧰 Changes

This PR enables two rules in our ESM config:

  1. unicorn/prefer-module — this came up as a result of fix: don't use module oas-to-har#243 — this rule will prevent a variety of Node/CommonJS usage patterns, such as __dirname, require, and module.exports (this rule slaps)
  2. node/no-extraneous-import — basically the ESM equivalent of node/no-extraneous-require

There are a slew of suggested ESM configuration options listed in this gist, but I decided to only enable these ones for now.

🧬 QA & Testing

Have I mentioned that the eslint-define-config types that we have in this repo are extremely handy?

@kanadgupta kanadgupta added the enhancement New feature or request label Oct 5, 2023
@kanadgupta kanadgupta requested a review from erunion October 5, 2023 16:25
@erunion erunion merged commit 4a2c68e into main Oct 5, 2023
2 checks passed
@erunion erunion deleted the more-esm branch October 5, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants