-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[linter] adding unnecessary_statements to the "recommended rule set" #59732
Comments
Does the unnecessary_statements lint do what you're looking for? |
@bwilkerson yes, thank you! you might consider adding it to the "recommended rule set" |
@bwilkerson not sure if you missed the question above. Someone just asked me about the same thing - he was surprised he had no diagnostic when he had the parens missing on a function call. Does this lint ever produce false positives, or does it only trigger when the statement geniunely does nothing? If the latter, could it be considered as a core lint - it could help new developers that aren't familiar with the difference. (I couldn't find if there's a process for suggesting new lints - are issues here the right way?). |
Sorry, yes, I forgot to answer the question: To propose a lint for inclusion in one of the existing lint sets (core, recommended, or flutter), please open an issue in the lints repository, discussing the value of the lint and, if the lint has false-positives, why you think it's worth the possible noise or how we might remove the false positives.
Yes, it can have false positives, but as far as I know that will happen only when the language is used in a non-standard way. The example from the docs is a statement of the form |
@DanTup can you link the issue here so I can follow it too? |
@bwilkerson thanks! I saw the linter repo was marked archived and thought here might tbe the right place. Although I see the |
I was debugging and could not figure out why my code wasn't working and why I wasn't breaking in
bar
...Can we have a linter to detect this kind of statement:
functionName;
?From my understanding, these types of statements are not doing anything.
The author probably meats
functionName();
if it wasn't passed to anything.The text was updated successfully, but these errors were encountered: