Skip to content

Add no-named-default rule #2538

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

Merged
merged 12 commits into from
Jan 24, 2025
Merged

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Jan 23, 2025

Fixes #2087

Comment on lines +102 to +103
1 | import named from "foo";␊
2 | import defaultExport from "foo";␊
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I choose to duplicate import instead of

import defaultExport from "foo";
const named = defaultExport;

As mentioned in #2087 (comment) and #2087 (comment), because theoretically it can be a let, live binding is safer.

Anyway, it's just an edge case.

@fisker fisker marked this pull request as ready for review January 23, 2025 05:36
@fisker
Copy link
Collaborator Author

fisker commented Jan 24, 2025

@sindresorhus Thoughts? #2087 (comment)

fisker and others added 2 commits January 24, 2025 15:48
@sindresorhus sindresorhus merged commit ed8da1b into sindresorhus:main Jan 24, 2025
16 checks passed
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.

Rule proposal: no-named-default
2 participants