useDeprecatedReason
¥Summary
-
规则生效日期:
v1.9.0¥Rule available since:
v1.9.0 -
诊断类别:
lint/style/useDeprecatedReason¥Diagnostic Category:
lint/style/useDeprecatedReason -
此规则为推荐规则,默认启用。
¥This rule is recommended, which means is enabled by default.
-
此规则没有修复方案。
¥This rule doesn’t have a fix.
-
此规则的默认严重级别为 warning。
¥The default severity of this rule is warning.
-
来源:
¥Sources:
¥How to configure
{ "linter": { "rules": { "style": { "useDeprecatedReason": "error" } } }}¥Description
要求在使用 @deprecated 指令时指定 reason 参数。
¥Require specifying the reason argument when using @deprecated directive
此规则检查 @deprecated 指令的参数是否使用了 reason 参数,如果缺少该参数,则建议用户添加。
¥This rule checks the parameter of @deprecated directive for the use of reason argument,
suggesting user to add it in case the argument is missing.
¥Examples
¥Invalid
query { member @deprecated}code-block.graphql:2:10 lint/style/useDeprecatedReason ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ The directive `@deprecated` should have a `reason` argument.
1 │ query {
> 2 │ member @deprecated
│ ^^^^^^^^^^^
3 │ }
4 │
ℹ Add a `reason` argument to the directive.
¥Valid
query { member @deprecated(reason: "Why?")}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号