# noStringCaseMismatch

Rule `biome/noStringCaseMismatch`. Disallow comparison of expressions modifying the string case with non-compliant value.

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `correctness/noStringCaseMismatch` | yes | unsafe | group correctness, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/no-string-case-mismatch/) |

## Code examples

### Incorrect: the rule reports this

```js
if (s.toUpperCase() === "Abc") {}
```

```js
while (s.toLowerCase() === "Abc") {}
```

### Correct: the rule accepts this

```js
if (s.toUpperCase() === "ABC") {}
while (s.toLowerCase() === "abc") {}
for (;s.toLocaleLowerCase() === "ABC";) {}
while (s.toLocaleUpperCase() === "abc") {}
for (let s = "abc"; s === "abc"; s = s.toUpperCase()) {}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noStringCaseMismatch": "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/noShorthandPropertyOverrides](https://lintradar.dev/rules/biome/noShorthandPropertyOverrides.md): Disallow shorthand properties that override earlier, more specific properties.
- [biome/noSuspiciousSemicolonInJsx](https://lintradar.dev/rules/biome/noSuspiciousSemicolonInJsx.md): It detects possible "wrong" semicolons inside JSX elements.
- [biome/noScssNullComparison](https://lintradar.dev/rules/biome/noScssNullComparison.md): Disallow comparing values to `null` in Sass `@if` conditions.
- [biome/noSvelteAddEventListener](https://lintradar.dev/rules/biome/noSvelteAddEventListener.md): Disallow `addEventListener` in Svelte files.
- [biome/noRedundantUseStrict](https://lintradar.dev/rules/biome/noRedundantUseStrict.md): Prevents from having redundant `"use strict"`.
- [biome/noSvelteAsyncStore](https://lintradar.dev/rules/biome/noSvelteAsyncStore.md): Disallow passing async functions to Svelte stores.

---

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