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

Breaking: Support ESM rules #177

Merged
merged 1 commit into from
Sep 26, 2021
Merged

Conversation

bmish
Copy link
Member

@bmish bmish commented Sep 21, 2021

Fixes #157. I recommend we add this to the upcoming v4 release (#120).

This change updates most rules (rules using our util getRuleInfo to read rule create/meta data) to support rules defined using the ES modules syntax as follows:

export default {
  meta: {},
  create(context) {}
};

TODO:

  • Add tests for all affected rules.
  • Support variables. We've never supported this so I don't think it's essential now. We can follow-up to try to add it later if we want.
    const rule = { meta: {}, create(context) {} }; 
    export default rule;
    
  • Support create function as the default export.

lib/utils.js Outdated Show resolved Hide resolved
@bmish bmish force-pushed the rule-esm branch 2 times, most recently from 7a12707 to fe3dac2 Compare September 23, 2021 02:26
@bmish bmish marked this pull request as ready for review September 23, 2021 02:47
@bmish bmish mentioned this pull request Sep 23, 2021
20 tasks
tests/lib/utils.js Outdated Show resolved Hide resolved
@aladdin-add
Copy link
Contributor

we need to resolve the conflicts. :)

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.

support esm
2 participants