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

Add no-anonymous-default-export rule #2273

Merged
merged 25 commits into from Feb 9, 2024

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Feb 6, 2024

Fixes #2264

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Ensuring that default exports are named helps improve the grepability of the codebase by encouraging the re-use of the same identifier for the module's default export at its declaration site and at its import sites.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@fisker fisker marked this pull request as ready for review February 6, 2024 18:26
@@ -134,7 +134,8 @@
]
}
],
"import/order": "off"
"import/order": "off",
"func-names": "off"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This rule not allow

module.exports = function eslintDonotAllowNameHere() {}

@sindresorhus sindresorhus merged commit c035216 into sindresorhus:main Feb 9, 2024
18 checks passed
@fisker fisker deleted the no-anonymous-default-export branch February 9, 2024 11:40
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-anonymous-default-export
2 participants