shorthand_sanitizer 0.6.0
shorthand_sanitizer: ^0.6.0 copied to clipboard
Type-resolved codemod that rewrites Type.member to Dart dot-shorthand .member when the rewrite provably resolves to the same element. Ships the dotsan CLI.
dart pub global activate shorthand_sanitizer
dotsan # sanitize lib/
dotsan lib test --dry-run # report only
dotsan --skip=AsyncValue.error # keep listed members prefixed
Before:
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [Text('hi', overflow: TextOverflow.ellipsis)],
)
After dotsan lib:
Column(
mainAxisAlignment: .start,
children: [Text('hi', overflow: .ellipsis)],
)