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

📎 Implement noDynamicNamespaceImportAccess #3240

Closed
minht11 opened this issue Jun 19, 2024 · 0 comments · Fixed by #3241
Closed

📎 Implement noDynamicNamespaceImportAccess #3240

minht11 opened this issue Jun 19, 2024 · 0 comments · Fixed by #3241

Comments

@minht11
Copy link
Contributor

minht11 commented Jun 19, 2024

Description

Implement rule discussed in #3164
Biome already has noNamespaceImport but that rule is likely too restrictive for general use. Instead this new rule proposes disallowing only dynamic access on namespaced imports, because if bundler can't determine what import to use at compile time it must include whole namespace, potentially increasing bundle size by a lot.

import * as m from './messages'
const dynamicKey = 'key'
m[key] // whole messages namespace must be included.

As far as I know this is unique rule.

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 a pull request may close this issue.

1 participant