Skip to content

Commit e8dc7de

Browse files
committed
feat: add property-no-deprecated rule
1 parent 5579b0f commit e8dc7de

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/rules/stylelint/index.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ import type { NoUnknownCustomPropertiesOptions } from './no-unknown-custom-prope
9393
import type { NumberMaxPrecisionOptions } from './number-max-precision'
9494
import type { PropertyAllowedListOptions } from './property-allowed-list'
9595
import type { PropertyDisallowedListOptions } from './property-disallowed-list'
96+
import type { PropertyNoDeprecatedOptions } from './property-no-deprecated'
9697
import type { PropertyNoUnknownOptions } from './property-no-unknown'
9798
import type { PropertyNoVendorPrefixOptions } from './property-no-vendor-prefix'
9899
import type { RuleEmptyLineBeforeOptions } from './rule-empty-line-before'
@@ -2169,6 +2170,25 @@ export interface StyleLintRules {
21692170
*/
21702171
'property-disallowed-list': PropertyDisallowedListOptions
21712172

2173+
/**
2174+
* Disallow deprecated properties.
2175+
*
2176+
* ```scss
2177+
* a { word-wrap: break-word; }
2178+
* // ^^^^^^^^^
2179+
* // Deprecated property
2180+
* ```
2181+
* This rule flags properties that were removed or deprecated after being in the CSS specifications, including editor drafts, and were either:
2182+
* - shipped in a stable version of a browser
2183+
* - shipped by a developer channel/edition browser
2184+
* - shipped but behind experimental flags
2185+
* - polyfilled with some adoption before any browser actually shipped
2186+
* - had an MDN page at one point in time
2187+
*
2188+
* @see [property-no-deprecated](https://stylelint.io/user-guide/rules/property-no-deprecated)
2189+
*/
2190+
'property-no-deprecated': PropertyNoDeprecatedOptions
2191+
21722192
/**
21732193
* Disallow unknown properties.
21742194
*
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { CSSPropertiesMap } from '../../types'
2+
import type { RuleConfig } from '../rule-config'
3+
4+
export type PropertyNoDeprecatedOptions = RuleConfig<true, {
5+
ignoreProperties?: (CSSPropertiesMap | RegExp)[]
6+
}>

0 commit comments

Comments
 (0)