# noDynamicNamespaceImportAccess

Rule `biome/noDynamicNamespaceImportAccess`. Disallow accessing namespace imports dynamically.

- Source: biome
- Technologies: JavaScript
- Kind: performance
- Needs type information: no
- Autofix: no
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #514 by reach, #149 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `performance/noDynamicNamespaceImportAccess` | yes | no | group performance, since 1.9.0 | [docs](https://biomejs.dev/linter/rules/no-dynamic-namespace-import-access/) |

## Code examples

### Incorrect: the rule reports this

```js
import * as foo from "foo"
foo["bar"]
```

```js
import * as foo from "foo"
const key = "bar"
foo[key]
```

### Correct: the rule accepts this

```js
import * as foo from "foo"
foo.bar
```

```js
import { bar } from "foo"
bar
```

```js
import messages from "i18n"
const knownMessagesMap = {
 hello: messages.hello,
 goodbye: messages.goodbye
}

const dynamicKey = "hello"
knownMessagesMap[dynamicKey]
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "performance": {
        "noDynamicNamespaceImportAccess": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/noDuplicateVariableNames](https://lintradar.dev/rules/biome/noDuplicateVariableNames.md): Require all variable definitions to be unique.
- [biome/noEmptyBlock](https://lintradar.dev/rules/biome/noEmptyBlock.md): Disallow empty CSS blocks.
- [biome/noDuplicateSelectorsKeyframeBlock](https://lintradar.dev/rules/biome/noDuplicateSelectorsKeyframeBlock.md): Disallow duplicate selectors within keyframe blocks.
- [biome/noEmptyTypeParameters](https://lintradar.dev/rules/biome/noEmptyTypeParameters.md): Disallow empty type parameters in type aliases and interfaces.
- [biome/noDuplicateProperties](https://lintradar.dev/rules/biome/noDuplicateProperties.md): Disallow duplicate properties within declaration blocks.
- [biome/noFlatMapIdentity](https://lintradar.dev/rules/biome/noFlatMapIdentity.md): Disallow to use unnecessary callback on `flatMap`.

---

Web page: https://lintradar.dev/rules/biome/noDynamicNamespaceImportAccess. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
