# useJsonImportAttributes

Rule `biome/useJsonImportAttributes`. Enforces the use of `with { type: "json" }` for JSON module imports.

- Source: biome
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1958 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `correctness/useJsonImportAttributes` | no | safe | group correctness, since 2.0.0 | [docs](https://biomejs.dev/linter/rules/use-json-import-attributes/) |

## Code examples

### Incorrect: the rule reports this

```js
import jsonData from './data.json';
```

```js
import jsonData from './data.json' with { someOtherAttribute: "value" };
```

### Correct: the rule accepts this

```js
import jsonData from './data.json' with { type: "json" };

import jsonData from './data.json' with { type: "json", other: "value" };

import code from './script.js'; // Not a JSON import
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "useJsonImportAttributes": "error"
      }
    }
  }
}
```

## Related rules

- [biome/useDisposables](https://lintradar.dev/rules/biome/useDisposables.md): Detects a disposable object assigned to a variable without using or await using syntax.
- [biome/useLayeredStyles](https://lintradar.dev/rules/biome/useLayeredStyles.md): Enforce style rules to be defined within a cascade layer.
- [biome/useDeprecatedDate](https://lintradar.dev/rules/biome/useDeprecatedDate.md): Require a valid deletion date on the `@deprecated` directive.
- [biome/useLogicalProperties](https://lintradar.dev/rules/biome/useLogicalProperties.md): Prefer logical CSS properties over physical properties.
- [biome/useConsistentLightnessNotation](https://lintradar.dev/rules/biome/useConsistentLightnessNotation.md): Enforce a consistent notation for the lightness of colors.
- [biome/useNamedLayer](https://lintradar.dev/rules/biome/useNamedLayer.md): Disallow anonymous cascade layers.

---

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