# unicode-bom

Rule `eslint/unicode-bom`. Require or disallow Unicode byte order mark (BOM)

- Source: eslint
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 20.1M weekly downloads of presets that enable it
- Trend: +11.7% last quarter
- Rank: #630 by reach, #1453 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicode-bom` | no | safe | package `eslint` | [docs](https://eslint.org/docs/latest/rules/unicode-bom) |
| Oxlint | `unicode-bom` | no | safe | plugin `eslint`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/unicode-bom.html) |
| Biome | `nursery/useConsistentUnicodeBom` | no | safe | group nursery, since 2.6.3 | [docs](https://biomejs.dev/linter/rules/use-consistent-unicode-bom/) |

## Code examples

### Incorrect: the rule reports this

```js
let abc;
```

```js
﻿// U+FEFF at the beginning

/*eslint unicode-bom: ["error", "never"]*/

let abc;
```

### Correct: the rule accepts this

```js
﻿// U+FEFF at the beginning

/*eslint unicode-bom: ["error", "always"]*/

let abc;
```

```js
let abc;
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "unicode-bom": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "unicode-bom": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useConsistentUnicodeBom": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [neostandard](https://lintradar.dev/presets/neostandard.md) | ESLint | `neostandard` | 95 | 317.6K | +50.2% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [eslint/no-useless-computed-key](https://lintradar.dev/rules/eslint/no-useless-computed-key.md): Disallow unnecessary computed property keys in objects and classes
- [eslint/no-throw-literal](https://lintradar.dev/rules/eslint/no-throw-literal.md): Disallow throwing literals as exceptions
- [eslint/no-multi-str](https://lintradar.dev/rules/eslint/no-multi-str.md): Disallow multiline strings
- [eslint/no-new](https://lintradar.dev/rules/eslint/no-new.md): Disallow `new` operators outside of assignments or comparisons
- [eslint/yoda](https://lintradar.dev/rules/eslint/yoda.md): Require or disallow "Yoda" conditions
- [eslint/no-new-func](https://lintradar.dev/rules/eslint/no-new-func.md): Disallow `new` operators with the `Function` object

---

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