diff --git a/CHANGELOG.md b/CHANGELOG.md index dc68294..8638344 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,18 @@ ## 3.0.0-wip -- Added to `core.yaml`: - - `collection_methods_unrelated_type` - - `implicit_call_tearoffs` - - `use_string_in_part_of_directives` -- Removed from `core.yaml`: - - `iterable_contains_unrelated_type` - - `list_remove_unrelated_type` +- `core`: + - added `collection_methods_unrelated_type` + - added `implicit_call_tearoffs` + - added `no_wildcard_variable_uses` + - added `secure_pubspec_urls` + - added `type_literal_in_constant_pattern` + - added `use_string_in_part_of_directives` + - removed `iterable_contains_unrelated_type` + - removed `list_remove_unrelated_type` +- `recommended`: + - added `unnecessary_to_list_in_spreads` + - added `use_super_parameters` + - removed `prefer_equal_for_default_values` - Add info about which lints have quick fixes to the package's readme. - Move the list of lint rules from the readme to a separate [rules.md](https://github.com/dart-lang/lints/blob/main/rules.md) file. diff --git a/lib/core.yaml b/lib/core.yaml index 622e45a..6bedf96 100644 --- a/lib/core.yaml +++ b/lib/core.yaml @@ -21,6 +21,7 @@ linter: - hash_and_equals - implicit_call_tearoffs - no_duplicate_case_values + - no_wildcard_variable_uses - non_constant_identifier_names - null_check_on_nullable_type_parameter - package_prefixed_library_names @@ -30,6 +31,8 @@ linter: - prefer_iterable_whereType - prefer_typing_uninitialized_variables - provide_deprecation_message + - secure_pubspec_urls + - type_literal_in_constant_pattern - unnecessary_overrides - unrelated_type_equality_checks - use_string_in_part_of_directives diff --git a/lib/recommended.yaml b/lib/recommended.yaml index b23dc46..1446fa9 100644 --- a/lib/recommended.yaml +++ b/lib/recommended.yaml @@ -37,7 +37,6 @@ linter: - prefer_collection_literals - prefer_conditional_assignment - prefer_contains - - prefer_equal_for_default_values - prefer_final_fields - prefer_for_elements_to_map_fromIterable - prefer_function_declarations_over_variables @@ -64,5 +63,7 @@ linter: - unnecessary_string_escapes - unnecessary_string_interpolations - unnecessary_this + - unnecessary_to_list_in_spreads - use_function_type_syntax_for_parameters - use_rethrow_when_possible + - use_super_parameters diff --git a/rules.md b/rules.md index 87bdfa8..06c3b3c 100644 --- a/rules.md +++ b/rules.md @@ -20,6 +20,7 @@ | [`hash_and_equals`](https://dart.dev/lints/hash_and_equals) | Always override `hashCode` if overriding `==`. | ✅ | | [`implicit_call_tearoffs`](https://dart.dev/lints/implicit_call_tearoffs) | Explicitly tear-off `call` methods when using an object as a Function. | ✅ | | [`no_duplicate_case_values`](https://dart.dev/lints/no_duplicate_case_values) | Don't use more than one case with same value. | ✅ | +| [`no_wildcard_variable_uses`](https://dart.dev/lints/no_wildcard_variable_uses) | Don't use wildcard parameters or variables. | | | [`non_constant_identifier_names`](https://dart.dev/lints/non_constant_identifier_names) | Name non-constant identifiers using lowerCamelCase. | ✅ | | [`null_check_on_nullable_type_parameter`](https://dart.dev/lints/null_check_on_nullable_type_parameter) | Don't use null check on a potentially nullable type parameter. | ✅ | | [`package_prefixed_library_names`](https://dart.dev/lints/package_prefixed_library_names) | Prefix library names with the package name and a dot-separated path. | | @@ -29,6 +30,8 @@ | [`prefer_iterable_whereType`](https://dart.dev/lints/prefer_iterable_whereType) | Prefer to use whereType on iterable. | ✅ | | [`prefer_typing_uninitialized_variables`](https://dart.dev/lints/prefer_typing_uninitialized_variables) | Prefer typing uninitialized variables and fields. | ✅ | | [`provide_deprecation_message`](https://dart.dev/lints/provide_deprecation_message) | Provide a deprecation message, via @Deprecated("message"). | | +| [`secure_pubspec_urls`](https://dart.dev/lints/secure_pubspec_urls) | Use secure urls in `pubspec.yaml`. | | +| [`type_literal_in_constant_pattern`](https://dart.dev/lints/type_literal_in_constant_pattern) | Don't use constant patterns with type literals. | ✅ | | [`unnecessary_overrides`](https://dart.dev/lints/unnecessary_overrides) | Don't override a method to do a super method invocation with the same parameters. | ✅ | | [`unrelated_type_equality_checks`](https://dart.dev/lints/unrelated_type_equality_checks) | Equality operator `==` invocation with references of unrelated types. | | | [`use_string_in_part_of_directives`](https://dart.dev/lints/use_string_in_part_of_directives) | Use string in part of directives. | ✅ | @@ -67,7 +70,6 @@ | [`prefer_collection_literals`](https://dart.dev/lints/prefer_collection_literals) | Use collection literals when possible. | ✅ | | [`prefer_conditional_assignment`](https://dart.dev/lints/prefer_conditional_assignment) | Prefer using `??=` over testing for null. | ✅ | | [`prefer_contains`](https://dart.dev/lints/prefer_contains) | Use contains for `List` and `String` instances. | ✅ | -| [`prefer_equal_for_default_values`](https://dart.dev/lints/prefer_equal_for_default_values) | Use `=` to separate a named parameter from its default value. | | | [`prefer_final_fields`](https://dart.dev/lints/prefer_final_fields) | Private field could be final. | ✅ | | [`prefer_for_elements_to_map_fromIterable`](https://dart.dev/lints/prefer_for_elements_to_map_fromIterable) | Prefer 'for' elements when building maps from iterables. | ✅ | | [`prefer_function_declarations_over_variables`](https://dart.dev/lints/prefer_function_declarations_over_variables) | Use a function declaration to bind a function to a name. | ✅ | @@ -94,8 +96,10 @@ | [`unnecessary_string_escapes`](https://dart.dev/lints/unnecessary_string_escapes) | Remove unnecessary backslashes in strings. | ✅ | | [`unnecessary_string_interpolations`](https://dart.dev/lints/unnecessary_string_interpolations) | Unnecessary string interpolation. | ✅ | | [`unnecessary_this`](https://dart.dev/lints/unnecessary_this) | Don't access members with `this` unless avoiding shadowing. | ✅ | +| [`unnecessary_to_list_in_spreads`](https://dart.dev/lints/unnecessary_to_list_in_spreads) | Unnecessary toList() in spreads. | ✅ | | [`use_function_type_syntax_for_parameters`](https://dart.dev/lints/use_function_type_syntax_for_parameters) | Use generic function type syntax for parameters. | ✅ | | [`use_rethrow_when_possible`](https://dart.dev/lints/use_rethrow_when_possible) | Use rethrow to rethrow a caught exception. | ✅ | +| [`use_super_parameters`](https://dart.dev/lints/use_super_parameters) | Use super-initializer parameters where possible. | ✅ | [Fix]: https://dart.dev/tools/dart-fix diff --git a/tool/rules.json b/tool/rules.json index 0844322..72f8b06 100644 --- a/tool/rules.json +++ b/tool/rules.json @@ -254,6 +254,11 @@ "description": "Annotate overridden members.", "fixStatus": "hasFix" }, + { + "name": "annotate_redeclares", + "description": "Annotate redeclared members.", + "fixStatus": "hasFix" + }, { "name": "avoid_annotating_with_dynamic", "description": "Avoid annotating with dynamic when not required.",