Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

add library_annotations; remove package_prefixed_library_names #179

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## 4.0.0-wip

- `core`:
- added `no_wildcard_variable_uses`
- added `library_annotations` (https://github.com/dart-lang/lints/issues/177)
- added `no_wildcard_variable_uses` (https://github.com/dart-lang/lints/issues/139)
- removed `package_prefixed_library_names` (https://github.com/dart-lang/lints/issues/172)
- Updated the SDK lower-bound to 3.1.
- Add a section on upgrading to the latest lint set to the readme.

Expand Down
2 changes: 1 addition & 1 deletion lib/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ linter:
- file_names
- hash_and_equals
- implicit_call_tearoffs
- library_annotations
- no_duplicate_case_values
- no_wildcard_variable_uses
- non_constant_identifier_names
- null_check_on_nullable_type_parameter
- package_prefixed_library_names
- prefer_generic_function_type_aliases
- prefer_is_empty
- prefer_is_not_empty
Expand Down
4 changes: 2 additions & 2 deletions rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- core -->
| Lint Rules | Description | [Fix][] |
| :--------- | :---------- | ------- |
| [`avoid_empty_else`](https://dart.dev/lints/avoid_empty_else) | Avoid empty else statements. | ✅ |
| [`avoid_empty_else`](https://dart.dev/lints/avoid_empty_else) | Avoid empty statements in else clauses. | ✅ |
Copy link
Member

@lrhn lrhn Feb 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in -> as

The "in" sounds like it includes {print();;}. Not that you shouldn't avoid that anyway, but this is not the lint for it.
(Does the lint only target ;, or also {}?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the ultimate system-of-record for this info are the lint descriptions at https://github.com/dart-lang/sdk/tree/main/pkg/linter/lib/src/rules. Any changes there will flow here (in a few steps).

| [`avoid_relative_lib_imports`](https://dart.dev/lints/avoid_relative_lib_imports) | Avoid relative imports for files in `lib/`. | ✅ |
| [`avoid_shadowing_type_parameters`](https://dart.dev/lints/avoid_shadowing_type_parameters) | Avoid shadowing type parameters. | |
| [`avoid_types_as_parameter_names`](https://dart.dev/lints/avoid_types_as_parameter_names) | Avoid types as parameter names. | ✅ |
Expand All @@ -20,11 +20,11 @@
| [`file_names`](https://dart.dev/lints/file_names) | Name source files using `lowercase_with_underscores`. | |
| [`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. | ✅ |
| [`library_annotations`](https://dart.dev/lints/library_annotations) | Attach library annotations to library directives. | ✅ |
| [`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. | |
| [`prefer_generic_function_type_aliases`](https://dart.dev/lints/prefer_generic_function_type_aliases) | Prefer generic function type aliases. | ✅ |
| [`prefer_is_empty`](https://dart.dev/lints/prefer_is_empty) | Use `isEmpty` for Iterables and Maps. | ✅ |
| [`prefer_is_not_empty`](https://dart.dev/lints/prefer_is_not_empty) | Use `isNotEmpty` for Iterables and Maps. | ✅ |
Expand Down
2 changes: 1 addition & 1 deletion tool/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"name": "avoid_empty_else",
"description": "Avoid empty else statements.",
"description": "Avoid empty statements in else clauses.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in -> as

"fixStatus": "hasFix"
},
{
Expand Down