# triple-slash-reference

Rule `typescript/triple-slash-reference`. Disallow certain triple slash directives in favor of ES6-style import declarations

- Source: typescript
- Technologies: TypeScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 260M weekly downloads of presets that enable it
- Trend: +52.6% last quarter
- Rank: #54 by reach, #761 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/triple-slash-reference` | yes | no | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/triple-slash-reference) |
| Oxlint | `typescript/triple-slash-reference` | yes | no | plugin `typescript`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/triple-slash-reference.html) |
| Biome | `nursery/noTripleSlashReference` | yes | no | group nursery, since 2.6.8 | [docs](https://biomejs.dev/linter/rules/no-triple-slash-reference/) |

## Code examples

### Incorrect: the rule reports this

```ts
/// <reference lib="code" />

globalThis.value;
```

```ts
/// <reference path="code" />

globalThis.value;
```

```ts
/// <reference types="code" />

globalThis.value;
```

### Correct: the rule accepts this

```ts
import { value } from 'code';
```

```ts
import { value } from 'code';
```

```ts
import { value } from 'code';
```

Examples from the ESLint documentation.

## Enable it

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

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/triple-slash-reference": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/triple-slash-reference": "error"
  }
}
```

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [typescript-eslint recommended](https://lintradar.dev/presets/typescript-eslint-recommended.md) | ESLint | `@typescript-eslint/eslint-plugin` | 24 | 175.9M | +29.5% |
| [Oxlint default](https://lintradar.dev/presets/oxlint-default.md) | Oxlint | `oxlint` | 111 | 50.8M | +183.6% |
| [typescript-eslint strict](https://lintradar.dev/presets/typescript-eslint-strict.md) | ESLint | `@typescript-eslint/eslint-plugin` | 32 | 175.9M | +29.5% |
| [typescript-eslint strict type-checked](https://lintradar.dev/presets/typescript-eslint-strict-type-checked.md) | ESLint | `@typescript-eslint/eslint-plugin` | 75 | 175.9M | +29.5% |
| [typescript-eslint recommended type-checked](https://lintradar.dev/presets/typescript-eslint-recommended-type-checked.md) | ESLint | `@typescript-eslint/eslint-plugin` | 47 | 175.9M | +29.5% |
| [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% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [Nuxt](https://lintradar.dev/presets/nuxt.md) | ESLint | `@nuxt/eslint-config` | 188 | 1.5M | +72.8% |
| [Google TypeScript Style](https://lintradar.dev/presets/gts.md) | ESLint | `gts` | 71 | 553.3K | +10.3% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [typescript/no-unsafe-declaration-merging](https://lintradar.dev/rules/typescript/no-unsafe-declaration-merging.md): Disallow unsafe declaration merging
- [typescript/no-misused-new](https://lintradar.dev/rules/typescript/no-misused-new.md): Enforce valid definition of `new` and `constructor`
- [typescript/no-extra-non-null-assertion](https://lintradar.dev/rules/typescript/no-extra-non-null-assertion.md): Disallow extra non-null assertions
- [typescript/prefer-namespace-keyword](https://lintradar.dev/rules/typescript/prefer-namespace-keyword.md): Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules
- [typescript/no-this-alias](https://lintradar.dev/rules/typescript/no-this-alias.md): Disallow aliasing `this`
- [typescript/no-non-null-asserted-optional-chain](https://lintradar.dev/rules/typescript/no-non-null-asserted-optional-chain.md): Disallow non-null assertions after an optional chain expression

---

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