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

New rule: no-mixed-exports #1

Merged
merged 5 commits into from
May 3, 2024
Merged

Conversation

MattisAbrahamsson
Copy link
Member

This PR adds a new rule "no-mixed-exports"

Mixed exports refers to a file having both a default export and named exports, for example:

export type Options = {
    value: number
}

export default myFunction(parameters: Options) {...}

We regularily comment on this in reviews, so to save us time I wrote this small rule which forbids mixing exports

@MattisAbrahamsson MattisAbrahamsson added the enhancement New feature or request label May 3, 2024
@MattisAbrahamsson MattisAbrahamsson requested review from oskarscholander and removed request for oskarscholander May 3, 2024 09:21
Copy link

@Kalle-Rei Kalle-Rei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff. Actually a bit surprised there isn't already a rule for this.

🫡 🇺🇦

@MattisAbrahamsson MattisAbrahamsson merged commit aabacd5 into main May 3, 2024
2 checks passed
@MattisAbrahamsson MattisAbrahamsson deleted the feature/no-mixed-exports branch May 3, 2024 12:35
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.

3 participants