You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider for var_with_no_type_annotatio for inclusion in core lintes #955
This lint aligns code with future language versions. Even considering code at existing language versions this is often a potential bug, or at best a style issue.
ACK. We should tell people to stop doing this (if they do, most don't anyway).
It's a temporary lint. When the language makes it invalid to write var foo as a parameter, the lint will stop mattering. (Although it probably still exists for code written for pre-feature language versions as long as those are supported.)
This should just be an analyzer warning. It's not something you should need to turn on or off, because nobody should turn it off. We want to scare people away from var and final in parameters as soon and decisively as possible.
There should be a fix (which just removes the var or final), so nobody needs to stick with code that gets the warning longer than it takes to run dart fix.
Nitpicking, the name and docs could be improved: "AVOID declaring parameters with var and no type annotation."
You can't declare parameters with varand a type annotation, so this is just "avoid declaring parameters with var."
The extra words are just confusing.
(And you also shouldn't declare parameters with final.)
Activity
lrhn commentedon Apr 24, 2026
ACK. We should tell people to stop doing this (if they do, most don't anyway).
It's a temporary lint. When the language makes it invalid to write
var fooas a parameter, the lint will stop mattering. (Although it probably still exists for code written for pre-feature language versions as long as those are supported.)This should just be an analyzer warning. It's not something you should need to turn on or off, because nobody should turn it off. We want to scare people away from
varandfinalin parameters as soon and decisively as possible.There should be a fix (which just removes the
varorfinal), so nobody needs to stick with code that gets the warning longer than it takes to rundart fix.Nitpicking, the name and docs could be improved: "AVOID declaring parameters with
varand no type annotation."You can't declare parameters with
varand a type annotation, so this is just "avoid declaring parameters withvar."The extra words are just confusing.
(And you also shouldn't declare parameters with
final.)natebosch commentedon Jun 3, 2026
Decision: Add to core set.