Skip to content
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

Avoid non null assertion check? #203

Closed
coladarci opened this issue Aug 24, 2024 · 1 comment
Closed

Avoid non null assertion check? #203

coladarci opened this issue Aug 24, 2024 · 1 comment

Comments

@coladarci
Copy link

Hello, all! I'm very new to the flutter / dart world but I'm a big fan.

In my early days of this journey I'm starting to feel that using the "trust me" ! operator can be abused by lazy engineers and goes against the entire reason for null safety in the first place. I'm sure there are times when it can't be avoided (?) but in those cases, I'd rather write an ignore: to the line to call it out.

I've researched this and found https://dcm.dev/docs/rules/common/avoid-non-null-assertion/ but couldn't find any linter in core dart/flutter linter that can do this. Am I missing something?

Thanks all for the great community!

@parlough
Copy link
Member

I'd also like to see a lint like this, but before it can be added to package:lints, the linter will need to add support for it.

I'll close this issue in favor of dart-lang/linter#3008 which proposes adding a similar lint. If you have anything to add, feel free to respond there. The CL(PR) https://dart-review.googlesource.com/c/sdk/+/337140 also has a proposal implementation.

Thanks for considering this :D

@parlough parlough closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants