# noInvalidPositionAtImportRule

Rule `biome/noInvalidPositionAtImportRule`. Disallow `@import` after other rules.

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `correctness/noInvalidPositionAtImportRule` | yes | no | group correctness, since 1.8.0 | [docs](https://biomejs.dev/linter/rules/no-invalid-position-at-import-rule/) |

## Code examples

### Incorrect: the rule reports this

```css
a {}
@import 'foo.css';
```

### Correct: the rule accepts this

```css
@import 'foo.css';
a {}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noInvalidPositionAtImportRule": "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/noInvalidGridAreas](https://lintradar.dev/rules/biome/noInvalidGridAreas.md): Disallow invalid named areas in CSS grid templates.
- [biome/noInvalidPropertyInitValue](https://lintradar.dev/rules/biome/noInvalidPropertyInitValue.md): Checks that the `initial-value` of an `@property` rule follows the value format declared by its `syntax`.
- [biome/noInvalidDirectionInLinearGradient](https://lintradar.dev/rules/biome/noInvalidDirectionInLinearGradient.md): Disallow non-standard directions in linear gradients.
- [biome/noJsonUnsafeValues](https://lintradar.dev/rules/biome/noJsonUnsafeValues.md): Disallow unsafe JSON values that may cause interoperability issues.
- [biome/noImportantInKeyframe](https://lintradar.dev/rules/biome/noImportantInKeyframe.md): Disallow `!important` in `@keyframes` declarations.
- [biome/noJsxNamespace](https://lintradar.dev/rules/biome/noJsxNamespace.md): Disallow JSX namespace syntax.

---

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