Skip to content

Commit 5dd4057

Browse files
committed
feat: add at-rule-descriptor-no-unknown rule
1 parent 18d6d83 commit 5dd4057

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
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 AtRuleDescriptorNoUnknownOptions = RuleConfig<true, {
4+
message?: string | ((atRule: string, descriptor: string) => string)
5+
}>

src/rules/stylelint/index.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { AlphaValueNotationOptions } from './alpha-value-notation'
22
import type { AnnotationNoUnknownOptions } from './annotation-no-unknown'
33
import type { AtRuleAllowedListOptions } from './at-rule-allowed-list'
4+
import type { AtRuleDescriptorNoUnknownOptions } from './at-rule-descriptor-no-unknown'
45
import type { AtRuleDisallowedListOptions } from './at-rule-disallowed-list'
56
import type { AtRuleEmptyLineBeforeOptions } from './at-rule-empty-line-before'
67
import type { AtRuleNoUnknownOptions } from './at-rule-no-unknown'
@@ -195,6 +196,22 @@ export interface StyleLintRules {
195196
*/
196197
'at-rule-allowed-list': AtRuleAllowedListOptions
197198

199+
/**
200+
* Disallow unknown descriptors for at-rules.
201+
*
202+
* >```scss
203+
* >@counter-style foo {
204+
* > unknown-descriptor: cyclic;
205+
* >// ^^^^^^^^^^^^^^^^^^
206+
* >// Descriptors like this
207+
* >}
208+
* >```
209+
* This rule considers descriptors defined in the CSS Specifications, up to and including Editor's Drafts, to be known.
210+
*
211+
* @see [at-rule-descriptor-no-unknown](https://stylelint.io/user-guide/rules/at-rule-descriptor-no-unknown)
212+
*/
213+
'at-rule-descriptor-no-unknown': AtRuleDescriptorNoUnknownOptions
214+
198215
/**
199216
* Specify a list of disallowed at-rules.
200217
*

0 commit comments

Comments
 (0)