Open duttaoindril opened 3 years ago
If we add this support, then I would recommend making these be two separate lints so that teams can associate different severities with the different language features.
If we add this support, then I would recommend making these be two separate lints so that teams can associate different severities with the different language features.
Definitely.
If anyone is interested to try those rules, we have them implemented in additional dart linter called Dart Code Metrics. Here is the docs for avoid late keyword and avoid non null assertion. Any feedback is welcome!
Describe the rule you'd like to see implemented A lint rule that just shows the presence of the postfix bang/exclamation null safety
!
andlate
variable type.This way, a team can decide if it's:
ignore
-”No preference.”
info
-"Best Practices are to not use this."
warning
-"Using this may cause the application to break in runtime."
error
-"To keep in line with code standards, we don't want to use this."
This could be very helpful to reach true compile-time sound null safety as we migrate to it fully.
Examples
https://dart.dev/null-safety/understanding-null-safety#late-variables