Modify rule S1481: Unused local variables should be removed (unused_local_variable)

This commit is contained in:
Antonio Aversa 2024-07-24 11:27:02 +02:00
parent 4b834646d1
commit fd10c121eb

View File

@ -9,7 +9,7 @@ include::../how-to-fix-it.adoc[]
[source,dart,diff-id=1,diff-type=noncompliant]
----
int numberOfMinutes(int hours) {
int seconds = 0; // Noncompliant - seconds is unused
int seconds = 0; // Noncompliant: seconds is unused
return hours * 60;
}
----
@ -25,4 +25,26 @@ int numberOfMinutes(int hours) {
== Resources
* https://dart.dev/tools/linter-rules/curly_braces_in_flow_control_structures[Dart compiler diagnostic]
* Dart Docs - https://dart.dev/tools/diagnostic-messages#unused_local_variable[Dart Compiler diagnostic - unused_local_variable]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* The value of the local variable '<variableName>' isn't used.
=== Highlighting
The identifier of the unused local variable.
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]