useDeprecatedReason
Summary
Section titled Summary- Rule available since:
v1.9.0 - Diagnostic Category:
lint/nursery/useDeprecatedReason - This rule doesn’t have a fix.
- The default severity of this rule is information.
- Sources:
Description
Section titled DescriptionRequire specifying the reason argument when using @deprecated directive
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
Section titled ExamplesInvalid
Section titled Invalidquery { member @deprecated}code-block.graphql:2:10 lint/nursery/useDeprecatedReason ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ The directive @deprecated should have a reason argument.
1 │ query {
> 2 │ member @deprecated
│ ^^^^^^^^^^^
3 │ }
4 │
ℹ Add a reason argument to the directive.
Valid
Section titled Validquery { member @deprecated(reason: "Why?")}How to configure
Section titled How to configure{ "linter": { "rules": { "nursery": { "useDeprecatedReason": "error" } } }}