Skip to content

Stricter ESM function-style rule detection #210

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

Closed
bmish opened this issue Oct 13, 2021 · 1 comment · Fixed by #211
Closed

Stricter ESM function-style rule detection #210

bmish opened this issue Oct 13, 2021 · 1 comment · Fixed by #211

Comments

@bmish
Copy link
Member

bmish commented Oct 13, 2021

We currently look for:

  • module.exports = function (context) { ... }
  • export default function (context) { ... }

We could look for a default-exported function that has at least one object return:

  • module.exports = function (context) { return { ... } }
  • export default function (context) { return { ... } }

This would help reduce false positives.

Originally posted by @bmish in #201 (comment)

@bmish
Copy link
Member Author

bmish commented Oct 13, 2021

@aladdin-add I'll give this a try today.

@bmish bmish changed the title Stricter ESM function rule detection Stricter ESM function-style rule detection Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant