Skip to content

Commit 84e1997

Browse files
committed
feat: add declaration-property-value-keyword-no-deprecated rule
1 parent 4208f2d commit 84e1997

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { RuleConfig } from '../rule-config'
2+
3+
export type DeclarationPropertyValueKeywordNoDeprecatedOptions = RuleConfig<true, {
4+
ignoreKeywords?: (RegExp | string)[]
5+
message?: string | ((property: string, keyword: string) => string)
6+
}>

src/rules/stylelint/index.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import type { DeclarationPropertyUnitAllowedListOptions } from './declaration-pr
3838
import type { DeclarationPropertyUnitDisallowedListOptions } from './declaration-property-unit-disallowed-list'
3939
import type { DeclarationPropertyValueAllowedListOptions } from './declaration-property-value-allowed-list'
4040
import type { DeclarationPropertyValueDisallowedListOptions } from './declaration-property-value-disallowed-list'
41+
import type { DeclarationPropertyValueKeywordNoDeprecatedOptions } from './declaration-property-value-keyword-no-deprecated'
4142
import type { DeclarationPropertyValueNoUnknownOptions } from './declaration-property-value-no-unknown'
4243
import type { FontFamilyNameQuotesOptions } from './font-family-name-quotes'
4344
import type { FontFamilyNoDuplicateNamesOptions } from './font-family-no-duplicate-names'
@@ -987,6 +988,26 @@ export interface StyleLintRules {
987988
*/
988989
'declaration-property-value-disallowed-list': DeclarationPropertyValueDisallowedListOptions
989990

991+
/**
992+
* Disallow deprecated keywords for properties within declarations.
993+
*
994+
* ```scss
995+
* a { color: ThreeDDarkShadow; }
996+
* // ^^^^^ ^^^^^^^^^^^^^^^^
997+
* // property and value pairs like these
998+
* ```
999+
*
1000+
* This rule flags keywords that were removed or deprecated after being in the CSS specifications, including editor drafts, and were subsequently either:
1001+
* - shipped in a stable version of a browser
1002+
* - shipped by a developer channel/edition browser
1003+
* - shipped but behind experimental flags
1004+
* - polyfilled with some adoption before any browser actually shipped
1005+
* - had an MDN page at one point in time
1006+
*
1007+
* @see [declaration-property-value-keyword-no-deprecated](https://stylelint.io/user-guide/rules/declaration-property-value-keyword-no-deprecated)
1008+
*/
1009+
'declaration-property-value-keyword-no-deprecated': DeclarationPropertyValueKeywordNoDeprecatedOptions
1010+
9901011
/**
9911012
* Disallow unknown values for properties within declarations.
9921013
*

0 commit comments

Comments
 (0)