src/content/docs/linter/rules/no-unknown-unit.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="CSS" icon="seti:css"> ## Summary - Rule available since: `v1.8.0` - Diagnostic Category: [`lint/correctness/noUnknownUnit`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**error**](/reference/diagnostics#error). - Sources: - Same as [`unit-no-unknown`](https://github.com/stylelint/stylelint/blob/main/lib/rules/unit-no-unknown/README.md){
"linter": {
"rules": {
"correctness": {
"noUnknownUnit": "error"
}
}
}
}
Disallow unknown CSS units.
For details on known CSS units, see the MDN web docs.
a {
width: 10pixels;
}
a {
width: calc(10px + 10pixels);
}
a {
width: 10px;
}
a {
width: 10Px;
}
a {
width: 10pX;
}
a {
width: calc(10px + 10px);
}