Skip to content

Commit 4208f2d

Browse files
committed
feat: add at-rule-prelude-no-invalid rule
1 parent 4b5c52c commit 4208f2d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { AtRules } from '../../types'
2+
import type { RuleConfig } from '../rule-config'
3+
4+
export type AtRulePreludeNoInvalidOptions = RuleConfig<true, {
5+
ignoreAtRules?: (RegExp | AtRules)[]
6+
message?: string | ((atRule: string, prelude: string) => string)
7+
}>

src/rules/stylelint/index.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { AtRuleEmptyLineBeforeOptions } from './at-rule-empty-line-before'
88
import type { AtRuleNoDeprecatedOptions } from './at-rule-no-deprecated'
99
import type { AtRuleNoUnknownOptions } from './at-rule-no-unknown'
1010
import type { AtRuleNoVendorPrefixOptions } from './at-rule-no-vendor-prefix'
11+
import type { AtRulePreludeNoInvalidOptions } from './at-rule-prelude-no-invalid'
1112
import type { AtRulePropertyRequiredListOptions } from './at-rule-property-required-list'
1213
import type { BlockNoEmptyOptions } from './block-no-empty'
1314
import type { ColorFunctionNatationOptions } from './color-function-notation'
@@ -334,6 +335,21 @@ export interface StyleLintRules {
334335
*/
335336
'at-rule-no-vendor-prefix': AtRuleNoVendorPrefixOptions
336337

338+
/**
339+
* Disallow invalid preludes for at-rules.
340+
*
341+
* >```scss
342+
* >@property --foo {}
343+
* >// ^^^^^
344+
* >// Preludes like this
345+
* >```
346+
*
347+
* This rule considers preludes for at-rules defined within the CSS specifications, up to and including Editor's Drafts, to be valid.
348+
*
349+
* @see [at-rule-prelude-no-invalid](https://stylelint.io/user-guide/rules/at-rule-prelude-no-invalid)
350+
*/
351+
'at-rule-prelude-no-invalid': AtRulePreludeNoInvalidOptions
352+
337353
/**
338354
* Specify a list of required properties for an at-rule.
339355
*

0 commit comments

Comments
 (0)