df_safer_dart_lints 0.5.2
df_safer_dart_lints: ^0.5.2 copied to clipboard
Lints for the df_safer_dart package. Uses annotations from the df_safer_dart_annotation package.
Changelog #
0.5.2 #
- feat: new
sendable(warning) andsendable_or_error(error) lints reject arguments to@sendable/@sendableOrErrorparameters that cannot surviveSendPort.send. Closures, instance-method tear-offs, and local-function references are rejected; top-level functions and static methods are accepted. The rule is a no-op for non-function-typed parameters. - Bumps
df_safer_dart_annotationsto^0.3.1to pick up the new@sendable/@sendableOrErrorannotations.
0.5.1 #
- fix:
must_use_outcomenow usesisAssignableFromTypeinstead ofisSuperTypeOfwhen matching againstOutcome. The rule now fires on expressions whose static type is assignable toOutcome(including cases involving generic bounds and other subtyping nuances) that the stricter supertype-only check previously missed.
0.5.0 #
- fix:
must_be_strong_refno longer fires when a top-level function or a static method is passed to a@mustBeStrongRefparameter. Both have program-/class-lifetime references by definition, so they are valid "strong" refs. Previously only instance-method tear-offs were accepted. - feat:
must_handle_returnis no longer@Deprecated. Use it alongside@useResultfor the warning-vs-error split. The rule's doc comment now mentions@useResultas the standard alternative for new code. - perf:
must_use_unsafe_wrapperandmust_handle_returnskip doc-comment references with an O(1)node.parent is CommentReferencecheck instead of walking the parent chain. These rules fire on every identifier in a file, so the win is felt on every analyzer pass. - perf:
must_handle_returnreorders its checks so the cheap parent walk (_isResultUnused) runs before the element-metadata walk (_hasMustHandleReturnAnnotation).