performance/noDynamicNamespaceImportAccess
performance · since 1.9.0
No autofixRecommended
biome.json
{
"linter": {
"rules": {
"performance": {
"noDynamicNamespaceImportAccess": "error"
}
}
}
}Disallow accessing namespace imports dynamically.
import * as foo from "foo"
foo["bar"]import * as foo from "foo"
const key = "bar"
foo[key]import * as foo from "foo"
foo.barimport { bar } from "foo"
barimport messages from "i18n"
const knownMessagesMap = {
hello: messages.hello,
goodbye: messages.goodbye
}
const dynamicKey = "hello"
knownMessagesMap[dynamicKey]Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
performance/noDynamicNamespaceImportAccess
performance · since 1.9.0
{
"linter": {
"rules": {
"performance": {
"noDynamicNamespaceImportAccess": "error"
}
}
}
}Require all variable definitions to be unique.
Disallow duplicate selectors within keyframe blocks.
Disallow empty type parameters in type aliases and interfaces.
Disallow duplicate properties within declaration blocks.
Disallow to use unnecessary callback on flatMap.