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

Rule proposal: no-anonymous-default-export #2264

Closed
fisker opened this issue Jan 19, 2024 · 2 comments · Fixed by #2273
Closed

Rule proposal: no-anonymous-default-export #2264

fisker opened this issue Jan 19, 2024 · 2 comments · Fixed by #2273

Comments

@fisker
Copy link
Collaborator

fisker commented Jan 19, 2024

Description

Implement a replacement rule for existing rule import/no-anonymous-default-export.

Fail

export default function () {}
export default class {}
export default () => {}

Pass

class A {}
export default A;
export default class A {};
function a {}
export default a;
export default function a {}
export default [];
export default {};
export default 1;
export default whatever;

Additional Info

For now, I only care about functions and classes, but we can check others in the future.

Maybe we can also suggest a fix based on the filename.

@fregante
Copy link
Collaborator

Extracted from #1089 (comment)

@fisker fisker self-assigned this Feb 6, 2024
@fisker
Copy link
Collaborator Author

fisker commented Feb 6, 2024

Marked as accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants