# noScssNullComparison

Rule `biome/noScssNullComparison`. Disallow comparing values to `null` in Sass `@if` conditions.

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/noScssNullComparison` | yes | no | group nursery, since 2.6.7 | [docs](https://biomejs.dev/linter/rules/no-scss-null-comparison/) |

## Code examples

### Incorrect: the rule reports this

```scss
a {
  @if $value == null {}
}
```

```scss
a {
  @if $value != null {}
}
```

### Correct: the rule accepts this

```scss
a {
  @if $value {}
  @if not $value {}
  @if $value != null and $value > 1 {}
}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noScssNullComparison": "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/noRedundantUseStrict](https://lintradar.dev/rules/biome/noRedundantUseStrict.md): Prevents from having redundant `"use strict"`.
- [biome/noShorthandPropertyOverrides](https://lintradar.dev/rules/biome/noShorthandPropertyOverrides.md): Disallow shorthand properties that override earlier, more specific properties.
- [biome/noReactSpecificProps](https://lintradar.dev/rules/biome/noReactSpecificProps.md): Prevents React-specific JSX properties from being used.
- [biome/noStringCaseMismatch](https://lintradar.dev/rules/biome/noStringCaseMismatch.md): Disallow comparison of expressions modifying the string case with non-compliant value.
- [biome/noReactNativeRawText](https://lintradar.dev/rules/biome/noReactNativeRawText.md): Disallow raw text outside `<Text>` components in React Native.
- [biome/noSuspiciousSemicolonInJsx](https://lintradar.dev/rules/biome/noSuspiciousSemicolonInJsx.md): It detects possible "wrong" semicolons inside JSX elements.

---

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