# prefer-explicit-viewport-units

Rule `unicorn/prefer-explicit-viewport-units`. Moved to `eslint-cssicorn` as `cssicorn/prefer-explicit-viewport-units`.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Deprecated: yes
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2031 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/prefer-explicit-viewport-units` | no | no | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/deleted-and-deprecated-rules.md#prefer-explicit-viewport-units) |

## Enable it

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

```js
import unicorn from "eslint-plugin-unicorn";

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/prefer-explicit-viewport-units": "error",
    },
  },
];
```

## Related rules

- [unicorn/prefer-error-is-error](https://lintradar.dev/rules/unicorn/prefer-error-is-error.md): Prefer `Error.isError()` when checking for errors.
- [unicorn/prefer-iterator-concat](https://lintradar.dev/rules/unicorn/prefer-iterator-concat.md): Prefer `Iterator.concat(…)` over temporary spread arrays.
- [unicorn/prefer-dispose](https://lintradar.dev/rules/unicorn/prefer-dispose.md): Prefer using `using`/`await using` over manual `try`/`finally` resource disposal.
- [unicorn/prefer-json-import](https://lintradar.dev/rules/unicorn/prefer-json-import.md): Prefer JSON imports over reading and parsing JSON files.
- [unicorn/no-unused-properties](https://lintradar.dev/rules/unicorn/no-unused-properties.md): Disallow unused object properties.
- [unicorn/prefer-regexp-escape](https://lintradar.dev/rules/unicorn/prefer-regexp-escape.md): Prefer `RegExp.escape()` for escaping strings to use in regular expressions.

---

Web page: https://lintradar.dev/rules/unicorn/prefer-explicit-viewport-units. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
