# valid-title

Rule `vitest/valid-title`. Enforce valid titles

- Source: vitest
- Technologies: Testing
- Kind: correctness
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 5.9M weekly downloads of presets that enable it
- Trend: +61.5% last quarter
- Rank: #1394 by reach, #695 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vitest/valid-title` | yes | safe | package `@vitest/eslint-plugin` | [docs](https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md) |
| Oxlint | `vitest/valid-title` | no | safe | plugin `vitest`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/vitest/valid-title.html) |
| Biome | `nursery/useValidTestTitle` | no | safe | group nursery, since 2.5.14 | [docs](https://biomejs.dev/linter/rules/use-valid-test-title/) |

## Code examples

### Incorrect: the rule reports this

```js
describe(1, () => {
  it('should be a number', () => {
    expect(1).toBe(1)
  })
})
```

```js
describe('foo', () => {
  it('Includes ng keyword Bar', () => {
    expect(1).toBe(1)
  })
})
```

```js
describe('foo', () => {
  it('  ', () => {
    expect(1).toBe(1)
  })
})
```

### Correct: the rule accepts this

```js
describe('1', () => {
  it('should be a number', () => {
    expect(1).toBe(1)
  })
})
```

```js
describe('name', () => {
  it('name', () => {})
})
```

```js
describe(foo, () => {
  it(hoge, () => {})
})
```

Examples from the ESLint documentation.

## Enable it

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

```js
import vitest from "@vitest/eslint-plugin";

export default [
  {
    plugins: { vitest },
    rules: {
      "vitest/valid-title": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "vitest"
  ],
  "rules": {
    "vitest/valid-title": "error"
  }
}
```

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Vitest recommended](https://lintradar.dev/presets/vitest-recommended.md) | ESLint | `@vitest/eslint-plugin` | 17 | 5.9M | +61.5% |

## Related rules

- [jest/valid-title](https://lintradar.dev/rules/jest/valid-title.md): Enforce valid titles
- [vitest/no-standalone-expect](https://lintradar.dev/rules/vitest/no-standalone-expect.md): Disallow using `expect` outside of `it` or `test` blocks
- [vitest/no-commented-out-tests](https://lintradar.dev/rules/vitest/no-commented-out-tests.md): Disallow commented out tests
- [vitest/no-focused-tests](https://lintradar.dev/rules/vitest/no-focused-tests.md): Disallow focused tests
- [vitest/no-interpolation-in-snapshots](https://lintradar.dev/rules/vitest/no-interpolation-in-snapshots.md): Disallow string interpolation in snapshots
- [vitest/no-disabled-tests](https://lintradar.dev/rules/vitest/no-disabled-tests.md): Disallow disabled tests

---

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