# usePackageJsonValidCpu

Rule `biome/usePackageJsonValidCpu`. Require the `cpu` field in `package.json` to be a valid list of processor types.

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/usePackageJsonValidCpu` | yes | no | group nursery, since 2.6.3 | [docs](https://biomejs.dev/linter/rules/use-package-json-valid-cpu/) |

## Code examples

### Incorrect: the rule reports this

```json
{
    "cpu": "x64"
}
```

```json
{
    "cpu": ["x64", 64]
}
```

```json
{
    "cpu": ["x64", ""]
}
```

### Correct: the rule accepts this

```json
{
    "cpu": ["x64", "arm64"]
}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "usePackageJsonValidCpu": "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/useLoneAnonymousOperation](https://lintradar.dev/rules/biome/useLoneAnonymousOperation.md): Disallow an anonymous operation in a document with other operations.
- [biome/usePackageJsonValidEngines](https://lintradar.dev/rules/biome/usePackageJsonValidEngines.md): Enforce that the `engines` field in `package.json` is valid.
- [biome/useImageSize](https://lintradar.dev/rules/biome/useImageSize.md): Enforces that `<img>` elements have both width and height attributes.
- [biome/usePackageJsonValidLicense](https://lintradar.dev/rules/biome/usePackageJsonValidLicense.md): Require the `license` field in `package.json` to be a valid license.
- [biome/useGraphqlNamedOperations](https://lintradar.dev/rules/biome/useGraphqlNamedOperations.md): Require a name for every explicit GraphQL operation definition.
- [biome/usePlaywrightValidDescribeCallback](https://lintradar.dev/rules/biome/usePlaywrightValidDescribeCallback.md): Enforce valid `describe()` callback.

---

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