Modify rule S1874: Add Dart language
This commit is contained in:
parent
f34e144d7b
commit
f581a56ea2
3
rules/S1874/dart/metadata.json
Normal file
3
rules/S1874/dart/metadata.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"title": "Code annotated as deprecated should not be used"
|
||||
}
|
19
rules/S1874/dart/rule.adoc
Normal file
19
rules/S1874/dart/rule.adoc
Normal 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[]
|
Loading…
x
Reference in New Issue
Block a user