Modify rule S1874: Add Dart language

This commit is contained in:
Marharyta Nedzelska 2024-07-10 15:55:50 +02:00 committed by Marharyta
parent f34e144d7b
commit f581a56ea2
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{
"title": "Code annotated as deprecated should not be used"
}

View File

@ -0,0 +1,19 @@
== 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"
----
include::../see.adoc[]