Skip to content

Commit

Permalink
Remove deprecated lints for Dart 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy committed Feb 14, 2025
1 parent c971380 commit f46826c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 67 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 2.4.0

Requires Dart `sdk: '>=3.3.0'`

- Remove [`iterable_contains_unrelated_type`](https://dart-lang.github.io/linter/lints/iterable_contains_unrelated_type.html)
- Remove [`list_remove_unrelated_type`](https://dart-lang.github.io/linter/lints/list_remove_unrelated_type.html)
- Remove [`always_require_non_null_named_parameters`](https://dart-lang.github.io/linter/lints/always_require_non_null_named_parameters.html)
- Remove [`avoid_returning_null`](https://dart-lang.github.io/linter/lints/avoid_returning_null.html)
- Remove [`avoid_returning_null_for_future`](https://dart-lang.github.io/linter/lints/avoid_returning_null_for_future.html)

## 2.3.0

Requires Dart `sdk: '>=3.2.0'`
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Generally, you can just put `lint: ^2.0.0` in your `pubspec.yaml` and pub get th

| Dart Version | Lint Version |
|--------------|---------------------------------------------------------------------|
| `3.3` | [`2.4.0`](https://pub.dev/packages/lint/versions/2.4.0/changelog) |
| `3.2` | [`2.3.0`](https://pub.dev/packages/lint/versions/2.3.0/changelog) |
| `3.1` | [`2.2.0`](https://pub.dev/packages/lint/versions/2.2.0/changelog) |
| `3.0` | [`2.1.0`](https://pub.dev/packages/lint/versions/2.1.0/changelog) |
Expand Down
33 changes: 2 additions & 31 deletions lib/casual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ linter:
# http://dart-lang.github.io/linter/lints/always_declare_return_types.html
# - always_put_required_named_parameters_first

# All non nullable named parameters should be and annotated with @required.
# This allows API consumers to get warnings via lint rather than a crash a runtime.
# Might become obsolete with Non-Nullable types
#
# http://dart-lang.github.io/linter/lints/always_require_non_null_named_parameters.html
- always_require_non_null_named_parameters

# Always use package: imports.
# While both, relative and package imports are fine, package imports are preferred because they allow for easy find
Expand Down Expand Up @@ -230,20 +224,6 @@ linter:
# https://dart-lang.github.io/linter/lints/avoid_return_types_on_setters.html
- avoid_return_types_on_setters

# Since nullsafety landed in dart, `int?` is completely fine to return null and `int` can't return `null` at all.
#
# In general there are plenty of valid reasons to return `null`, not a useful rule
#
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
#
# https://dart-lang.github.io/linter/lints/avoid_returning_null.html
# - avoid_returning_null

# Don't use `Future?`, therefore never return null instead of a Future.
# Will become obsolete one Non-Nullable types land
# https://dart-lang.github.io/linter/lints/avoid_returning_null_for_future.html
- avoid_returning_null_for_future

# Use empty returns, don't show off with your knowledge about dart internals.
# https://dart-lang.github.io/linter/lints/avoid_returning_null_for_void.html
- avoid_returning_null_for_void
Expand Down Expand Up @@ -516,10 +496,6 @@ linter:
# https://dart-lang.github.io/linter/lints/invalid_case_patterns.html
- invalid_case_patterns

# Deprecated, replaced by collection_methods_unrelated_type
#
# https://dart-lang.github.io/linter/lints/iterable_contains_unrelated_type.html
# - iterable_contains_unrelated_type

# Hint to join return and assignment.
#
Expand Down Expand Up @@ -562,11 +538,6 @@ linter:
# https://dart-lang.github.io/linter/lints/lines_longer_than_80_chars.html
# - lines_longer_than_80_chars

# Deprecated, replaced by collection_methods_unrelated_type
#
# https://dart-lang.github.io/linter/lints/list_remove_unrelated_type.html
# - list_remove_unrelated_type

# Good for libraries to prevent unnecessary code paths.
# False positives may occur for applications when boolean properties are generated by external programs
# producing auto-generated source code
Expand Down Expand Up @@ -616,14 +587,14 @@ linter:
# https://dart-lang.github.io/linter/lints/no_runtimeType_toString.html
- no_runtimeType_toString

# Dont assign a variable to itself.
# Don't assign a variable to itself.
#
# Dart SDK: >= 3.1.0
#
# https://dart.dev/tools/linter-rules/no_self_assignments
- no_self_assignments

# Dont use wildcard parameters or variables. Code using this will break in the future.
# Don't use wildcard parameters or variables. Code using this will break in the future.
#
# Dart SDK: >= 3.1.0
#
Expand Down
37 changes: 3 additions & 34 deletions lib/strict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ linter:
# http://dart-lang.github.io/linter/lints/always_declare_return_types.html
# - always_put_required_named_parameters_first

# All non nullable named parameters should be and annotated with @required.
# This allows API consumers to get warnings via lint rather than a crash a runtime.
# Might become obsolete with Non-Nullable types
#
# http://dart-lang.github.io/linter/lints/always_require_non_null_named_parameters.html
- always_require_non_null_named_parameters

# Always use package: imports.
# While both, relative and package imports are fine, package imports are preferred because they allow for easy find
# and replace
Expand Down Expand Up @@ -233,20 +226,6 @@ linter:
# https://dart-lang.github.io/linter/lints/avoid_return_types_on_setters.html
- avoid_return_types_on_setters

# Since nullsafety landed in dart, `int?` is completely fine to return null and `int` can't return `null` at all.
#
# In general there are plenty of valid reasons to return `null`, not a useful rule
#
# Dart SDK: >= 2.0.0 • (Linter v0.1.31)
#
# https://dart-lang.github.io/linter/lints/avoid_returning_null.html
# - avoid_returning_null

# Don't use `Future?`, therefore never return null instead of a Future.
# Will become obsolete one Non-Nullable types land
# https://dart-lang.github.io/linter/lints/avoid_returning_null_for_future.html
- avoid_returning_null_for_future

# Use empty returns, don't show off with your knowledge about dart internals.
# https://dart-lang.github.io/linter/lints/avoid_returning_null_for_void.html
- avoid_returning_null_for_void
Expand Down Expand Up @@ -453,7 +432,7 @@ linter:
# https://dart-lang.github.io/linter/lints/empty_catches.html
- empty_catches

# Removed empty constructor bodies
# Removes empty constructor bodies
#
# https://dart-lang.github.io/linter/lints/empty_constructor_bodies.html
- empty_constructor_bodies
Expand Down Expand Up @@ -519,11 +498,6 @@ linter:
# https://dart-lang.github.io/linter/lints/invalid_case_patterns.html
- invalid_case_patterns

# Deprecated, replaced by collection_methods_unrelated_type
#
# https://dart-lang.github.io/linter/lints/iterable_contains_unrelated_type.html
# - iterable_contains_unrelated_type

# Hint to join return and assignment.
#
# https://dart-lang.github.io/linter/lints/join_return_with_assignment.html
Expand Down Expand Up @@ -565,11 +539,6 @@ linter:
# https://dart-lang.github.io/linter/lints/lines_longer_than_80_chars.html
# - lines_longer_than_80_chars

# Deprecated, replaced by collection_methods_unrelated_type
#
# https://dart-lang.github.io/linter/lints/list_remove_unrelated_type.html
# - list_remove_unrelated_type

# Good for libraries to prevent unnecessary code paths.
# False positives may occur for applications when boolean properties are generated by external programs
# producing auto-generated source code
Expand Down Expand Up @@ -619,14 +588,14 @@ linter:
# https://dart-lang.github.io/linter/lints/no_runtimeType_toString.html
- no_runtimeType_toString

# Dont assign a variable to itself.
# Don't assign a variable to itself.
#
# Dart SDK: >= 3.1.0
#
# https://dart.dev/tools/linter-rules/no_self_assignments
- no_self_assignments

# Dont use wildcard parameters or variables. Code using this will break in the future.
# Don't use wildcard parameters or variables. Code using this will break in the future.
#
# Dart SDK: >= 3.1.0
#
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: lint
version: 2.3.0
version: 2.4.0
description: An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter
repository: https://github.com/passsy/dart-lint
issue_tracker: https://github.com/passsy/dart-lint/issues
topics:
- lint

environment:
sdk: '>=3.2.0 <4.0.0'
sdk: '>=3.3.0 <4.0.0'

0 comments on commit f46826c

Please sign in to comment.