rspec/rules/S1874/dart/rule.adoc

51 lines
1.5 KiB
Plaintext

== Why is this an issue?
include::../description.adoc[]
[source,dart]
----
@Deprecated("This function is deprecated, use newFunction instead", ReplaceWith("newFunction()"))
void oldFunction() {
println("This is the old function.");
}
void newFunction() {
println("This is the new function.");
}
oldFunction() // Noncompliant: "oldFunction is deprecated"
----
=== Exceptions
The rule does not raise an issue when the deprecated members are used in a deprecated type.
include::../see.adoc[]
* Dart Docs - https://dart.dev/tools/diagnostic-messages#deprecated_member_use[Dart Compiler diagnostic - deprecated_member_use]
* Dart Docs - https://dart.dev/tools/diagnostic-messages#deprecated_member_use_from_same_package[Dart Compiler diagnostic - deprecated_member_use_from_same_package]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* '<deprecatedMember>' is deprecated and shouldn't be used.
* '<deprecatedMember>' is deprecated and shouldn't be used. <reasonForDeprecation>.
Unlike in other scenarios, if the member is a setter, the method name will NOT end with a `=` sign (generally used to distinguish it from the corresponding getter).
`<reasonForDeprecation>` is appended only if the deprecated member has a deprecation message (e.g. `@Deprecated("Use X instead")`).
=== Highlighting
The identifier of the deprecated member.
'''
== Comments And Links
(visible only on this page)
endif::env-github,rspecator-view[]