solid_lints
solid_lints copied to clipboard
Review new lint rules from linter 3.0
Review new lint rules from linter 3.0 and enable if needed in solid_lints https://github.com/dart-lang/lints/blob/main/CHANGELOG.md#300
-
collection_methods_unrelated_type
- Unifies and replaces a couple lints that are now deprecated (list_remove_unrelated_type, iterable_contains_unrelated_type). We use both deprecated ones.
-
dangling_library_doc_comments
- Pretty self-explanatory. Worth adding.
-
implicit_call_tearoffs
- IMO very minor improvement. But
Future language versions may remove the implicit call tear off.
- IMO very minor improvement. But
-
secure_pubspec_urls
- Good for the majority of cases, but some orgs rely on SSH dependencies for their apps.
-
type_literal_in_constant_pattern
- Prevents mistyped conditionals not working. Useful, but will have to
ignorewhen we actually need to check for bare type. That's probably gonna be rare.
void main() { String f(Object? x) { return switch (x) { int => 'int type', // this will be linted with type_literal_in_constant_pattern enabled int _ => 'concrete int', _ => 'other', }; } print(f(int)); // int type print(f(1)); // concrete int print(f('x')); // other } - Prevents mistyped conditionals not working. Useful, but will have to
-
unnecessary_to_list_in_spreads
- Useful lint, potentially impactful on performance.
- use_super_parameters
- A bit of boilerplace reduction, would be niсe to have.
FYI these are already in our analysis_options.yaml (click to jump to code)