Skip to content

Commit b78279f

Browse files
committed
feat: add no-unknown-custom-media
1 parent 9dd0479 commit b78279f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/rules/stylelint/index.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ import type { UnitNoUnknownOptions } from './unit-no-unknown'
124124
import type { ValueKeywordCaseOptions } from './value-keyword-case'
125125
import type { ValueNoVendorPrefixOptions } from './value-no-vendor-prefix'
126126
import type { LightnessNotationOptions } from './lightness-notation'
127+
import type { NoUnknownCustomMediaOptions } from './no-unknown-custom-media'
127128

128129
/**
129130
* Rules determine what the linter looks for and complains about.
@@ -1842,6 +1843,25 @@ export interface StyleLintRules {
18421843
*/
18431844
'no-unknown-animations': NoUnknownAnimationsOptions
18441845

1846+
/**
1847+
* Disallow unknown custom media queries.
1848+
*
1849+
* ```scss
1850+
* \@custom-media --sm (min-width: 40rem);
1851+
* // ^^^^
1852+
* \@media (--sm) {}
1853+
* // ^^^^
1854+
* ```
1855+
*
1856+
* This rule considers custom media queries defined **within the same source** to be known.
1857+
*
1858+
* ### Primary Options:
1859+
* `true`
1860+
*
1861+
* @see [no-unknown-custom-media](https://stylelint.io/user-guide/rules/no-unknown-custom-media)
1862+
*/
1863+
'no-unknown-custom-media': NoUnknownCustomMediaOptions
1864+
18451865
/**
18461866
* Disallow unknown custom properties.
18471867
*
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { RuleConfig } from '../rule-config'
2+
3+
export type NoUnknownCustomMediaOptions = RuleConfig<
4+
true
5+
>

0 commit comments

Comments
 (0)