Skip to content

Commit

Permalink
chore(ci): pin submodule to 7ea5dff and run codegen (#133)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] authored Apr 23, 2024
1 parent b3ea393 commit b9141cf
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/generated/NumberOfRules.astro

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/content/docs/linter/rules/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,6 @@ Rules that belong to this group <strong>are not subject to semantic version</str
| [noReactSpecificProps](/linter/rules/no-react-specific-props) | Prevents React-specific JSX properties from being used. | <span aria-label="The rule has a safe fix" role="img" title="The rule has a safe fix">🔧 </span> |
| [noRestrictedImports](/linter/rules/no-restricted-imports) | Disallow specified modules when loaded by import or require. | |
| [noUndeclaredDependencies](/linter/rules/no-undeclared-dependencies) | Disallow the use of dependencies that aren't specified in the <code>package.json</code>. | |
| [noUnknownUnit](/linter/rules/no-unknown-unit) | Disallow unknown CSS units. | |
| [useImportRestrictions](/linter/rules/use-import-restrictions) | Disallows package private imports. | |
| [useSortedClasses](/linter/rules/use-sorted-classes) | Enforce the sorting of CSS utility classes. | <span aria-label="The rule has an unsafe fix" role="img" title="The rule has an unsafe fix">⚠️ </span> |
109 changes: 109 additions & 0 deletions src/content/docs/linter/rules/no-unknown-unit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: noUnknownUnit (not released)
---

**Diagnostic Category: `lint/nursery/noUnknownUnit`**

:::danger
This rule hasn't been released yet.
:::

:::caution
This rule is part of the [nursery](/linter/rules/#nursery) group.
:::

Sources:
- Same as: <a href="https://github.com/stylelint/stylelint/blob/main/lib/rules/unit-no-unknown/README.md" target="_blank"><code>stylelint/unit-no-unknown</code></a>

Disallow unknown CSS units.

For details on known CSS units, see the [MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#lengths).

## Examples

### Invalid

```css
a {
width: 10pixels;
}
```

<pre class="language-text"><code class="language-text">nursery/noUnknownUnit.js:2:12 <a href="https://biomejs.dev/linter/rules/no-unknown-unit">lint/nursery/noUnknownUnit</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

<strong><span style="color: Tomato;"> </span></strong><strong><span style="color: Tomato;">✖</span></strong> <span style="color: Tomato;">Unexpected unknown unit: </span><span style="color: Tomato;"><strong>pixels</strong></span>

<strong>1 │ </strong>a {
<strong><span style="color: Tomato;"> </span></strong><strong><span style="color: Tomato;">&gt;</span></strong> <strong>2 │ </strong> width: 10pixels;
<strong> │ </strong> <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong>
<strong>3 │ </strong>}
<strong>4 │ </strong>

<strong><span style="color: lightgreen;"> </span></strong><strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">See </span><span style="color: lightgreen;"><a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#lengths">MDN web docs</a></span><span style="color: lightgreen;"> for more details.</span>

<strong><span style="color: lightgreen;"> </span></strong><strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">Use a known unit instead, such as:</span>

- px
- em
- rem
- etc.

</code></pre>

```css
a {
width: calc(10px + 10pixels);
}
```

<pre class="language-text"><code class="language-text">nursery/noUnknownUnit.js:2:24 <a href="https://biomejs.dev/linter/rules/no-unknown-unit">lint/nursery/noUnknownUnit</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

<strong><span style="color: Tomato;"> </span></strong><strong><span style="color: Tomato;">✖</span></strong> <span style="color: Tomato;">Unexpected unknown unit: </span><span style="color: Tomato;"><strong>pixels</strong></span>

<strong>1 │ </strong>a {
<strong><span style="color: Tomato;"> </span></strong><strong><span style="color: Tomato;">&gt;</span></strong> <strong>2 │ </strong> width: calc(10px + 10pixels);
<strong> │ </strong> <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong>
<strong>3 │ </strong>}
<strong>4 │ </strong>

<strong><span style="color: lightgreen;"> </span></strong><strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">See </span><span style="color: lightgreen;"><a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#lengths">MDN web docs</a></span><span style="color: lightgreen;"> for more details.</span>

<strong><span style="color: lightgreen;"> </span></strong><strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">Use a known unit instead, such as:</span>

- px
- em
- rem
- etc.

</code></pre>

### Valid

```css
a {
width: 10px;
}
```

```css
a {
width: 10Px;
}
```

```css
a {
width: 10pX;
}
```

```css
a {
width: calc(10px + 10px);
}
```

## Related links

- [Disable a rule](/linter/#disable-a-lint-rule)
- [Rule options](/linter/#rule-options)

0 comments on commit b9141cf

Please sign in to comment.