linter
linter copied to clipboard
Fix false negative in `prefer_is_empty`
Fixes #2818
I hope it is fine to do this change, since not evaluating constants deliberately
in the old TODO, I guess it was added to retain the old behavior in the other PR.
Coverage remained the same at 93.976% when pulling 7930f25e8eae5385049fea1b204ef13634d83558 on asashour:2818_prefer_is_empty into def6bf20f22a8b974673606a942f392700efef31 on dart-lang:master.
I suspect that there was a reason why the TODO wasn't addressed before committing the lint, but I don't know / remember what it was. I think that Phil is out today, so this will need to wait until he's back.
Brian is right. This change has the potential to introduce a bunch of new diagnostics internally and so we need to proceed with caution. It's generally true of false negatives that they need to be landed with care since they can potentially be very impactful on the ecosystem.
I commented on the issue - I am against such a change :( https://github.com/dart-lang/linter/issues/2818#issuecomment-1337225760
Closing this as it is stale and needs more background work, see the referenced issue.