Skip to main content

property-no-deprecated

禁止使用已弃用的属性。

¥Disallow deprecated properties.

  a { word-wrap: break-word; }
/** ↑

* Deprecated property */

此规则标记在 CSS 规范(包括编辑器草稿)中被移除或弃用的属性,并且这些属性符合以下任一情况:

¥This rule flags properties that were removed or deprecated after being in the CSS specifications, including editor drafts, and were either:

  • 在浏览器的稳定版本中发布

    ¥shipped in a stable version of a browser

  • 由开发者通道/版本浏览器发布

    ¥shipped by a developer channel/edition browser

  • 发布但落后于实验标志

    ¥shipped but behind experimental flags

  • 在任何浏览器实际发布之前通过一些采用进行填充

    ¥polyfilled with some adoption before any browser actually shipped

  • 在某个时间点有一个 MDN 页面

    ¥had an MDN page at one point in time

fix 选项 可以自动修复此规则报告的一些问题。

¥The fix option can automatically fix some of the problems reported by this rule.

现有技术:

¥Prior art:

选项

¥Options

true

{
"property-no-deprecated": true
}

以下模式被视为问题:

¥The following patterns are considered problems:

a { clip: rect(0, 0, 0, 0); }
a { word-wrap: break-word; }

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { clip-path: rect(0, 0, 0, 0); }
a { overflow-wrap: break-word; }

可选的辅助选项

¥Optional secondary options

ignoreProperties

{ "ignoreProperties": ["array", "of", "properties", "/regex/"] }

鉴于:

¥Given:

{
"property-no-deprecated": [true, { "ignoreProperties": ["clip", "/^grid-/"] }]
}

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { clip: rect(0, 0, 0, 0); }
a { grid-row-gap: 4px; }