Skip to content

Drop CJS (module.exports)ย #213

@JasonWeinzierl

Description

@JasonWeinzierl

Are there any major objections to switching this plugin to ESM-only?

Currently, we distribute both ESM and CJS flavors in the same package. This means the plugin is ~300KB, twice the size it needs to be. We also need to maintain the build pipeline for supporting both ESM and CJS.

I'm proposing an ESM-only distribution, based on the following assumptions:

  • eslint supports .mjs config files (export default), and users should prefer this config style instead of CJS.
  • The ecosystem will continue to migrate toward ESM and drop CJS.
  • We already don't support the old .eslintrc format, so dropping backward compatibility is ok.
  • We still haven't released v1.0.0, so this is a great opportunity to introduce a breaking change before announcing stability.

Further info: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions