flutter_skill_lints 0.6.5
flutter_skill_lints: ^0.6.5 copied to clipboard
Analyzer plugin companion for the building-flutter-apps skill's Dart and Flutter guardrails.
Changelog #
0.6.5 - 2026-05-14 #
- Added
riverpod_consumer_state_derived_cachefor provider-derivedConsumerStatecache/source/day-start fields. - Added
l10n_context_direct_accessanddatetime_now_requires_timezone_intentfor l10n binding andDateTimeXcurrent-time intent. - Added
avoid_magic_literalsfor raw key/path/id/limit/date-window/threshold literals and comparisons. - Added
avoid_inline_error_codes,avoid_local_contract_key_constants, andavoid_flutter_skill_lint_suppressionfor contracts and suppressions. - Bumped Flutter skill rule count to 125 and diagnostic count to 132.
- Bumped additional analyzer warning rule count to 85.
0.6.4 - 2026-05-14 #
- Extended direct-route API diagnostics to catch route-specific wrapper methods
such as
router.goHome(). - Extended navigation wrapper/context escape diagnostics to catch helper calls
such as
navigateToHomeRoute(router)and routernavigatorKey.currentContext. - Extended manual provider detection to multiline and generic
Provider.family<...>declarations.
0.6.3 - 2026-05-13 #
- Added route SSOT diagnostics for generated typed route helpers:
router_direct_route_call,router_raw_route_definition,router_context_navigation_extension,router_navigation_wrapper_api,router_modal_local_helpers, androuter_container_navigation_escape. App code calls generated typed route helpers directly; raw route definitions stay in the router boundary or the shared test router helper. - Tightened
router_string_navso raw string and named route navigation are blocked outside test-host string-route fixtures. - Added
riverpod_manual_providerto enforce@riverpod/@Riverpodcodegen over manual provider declarations. - Bumped Flutter skill rule count to 122 and diagnostic count to 129.
0.6.2 - 2026-05-13 #
- Tightened
use_context_mounted_after_awaitsocontext.mountedafter an async gap only satisfies the guard whencontextis a function parameter or local variable captured before the gap. This catchesState.contextgetter reads such asif (!context.mounted) return;afterawait, which can throw when theStatehas already been disposed. Capture withfinal context = this.context;before awaiting.
0.6.1 - 2026-05-13 #
- Patch release for packaging/documentation alignment:
- Updated README, example, and project-config test snippets to state the
current
riverpod_lintprerelease pin accurately: latest stable is3.1.3; this package still tests against3.1.4-dev.3for Riverpod 3.3-era lint coverage. - No lint rule behavior changes.
- Updated README, example, and project-config test snippets to state the
current
0.6.0 - 2026-05-13 #
- BREAKING — VO subfolder renamed
/domain/value_objects/→/domain/values/. Path gates in 4 source-scanner rules (vo_public_raw_constructor,domain_entity_primitive_factory,domain_custom_copy_with,freezed_disable_map_when_required) and thehive_field_no_vo_typeimport-regex auto-extension now match/domain/values/. Consumers upgrading from 0.5.x MUST migrate:mv lib/**/domain/value_objects lib/**/domain/valuesper feature andlib/core/domain/value_objects→lib/core/domain/values.- Rewrite imports:
domain/value_objects/→domain/values/. - Re-run
dart analyze. Without the rename:
vo_public_raw_constructor,domain_custom_copy_with,freezed_disable_map_when_requiredsilently stop firing on existing VOs (3 guards regress).hive_field_no_vo_typeloses auto-extension from the old import path (Hive Model VO leak undetected).domain_entity_primitive_factorystarts erroring on every public primitive factory in old-path VOs (false positives across the board). Caret^0.5.xdoes NOT auto-pick this release — bump constraint to^0.6.0after migrating.
0.5.7 - 2026-05-13 #
-
Doc drift fix (tvly-verified vs hive_ce + pub.dev):
hive-persistence.md: replaced "infers HiveField(N) from ctor order" withhive_adapters.g.yamlSSOT mechanism. Migration table: rename =⚠️ manual yaml edit(was wrongly✅). Added rows for reorder + type change (both ❌, per official docs).value-objects.mdHive-collision: same correction + link to hive_ce docs.freezed_disable_map_when_requiredmessage now statesfreezed_annotation ^3.1.0floor (options removed in 3.0.0, re-added in 3.1.0).
-
Added
freezed_disable_map_when_required(ERROR) inlib/src/rules/value_object_source_rules.dart: sealed Freezed Value Objects in/domain/values/must annotate@Freezed(map: FreezedMapOptions.none, when: FreezedWhenOptions.none)to disable codegen of legacy.map()/.maybeMap()/.when()/.maybeWhen()methods. Those APIs bypass the sealed exhaustiveness check and are forbidden by Critical Rule 7. Native Dart 3switchbecomes the only pattern-matching surface. Catches bare@freezed, partial opt-out (one of map/when missing), and multi-line annotations. Non-sealed Freezed classes and files outside/domain/values/are unaffected. -
Bumped Flutter skill rule count to 115 and diagnostic count to 122.
-
Added Hive persistence boundary rule in
lib/src/rules/hive_persistence_source_rules.dart:hive_field_no_vo_type(ERROR): in/data/models/,@freezedconstructor parameters must not be typed as a Value Object. Catches nullable (Distance?), generic (List<Distance>,Map<String, Money>), andshow-clause-imported VOs. Persistence Models hold primitives; VOs live on the domain Entity; the mapper bridges viaDistance.fromMeters(...)intoEntity().
-
Extended
vo_public_raw_constructorto also catch zero-touch passthrough public factories (factory X.kilograms(double v) => X._kilograms(v);) — same risk as a raw redirect: caller skips validation. Validated factories (assert, transform, throw) and parameterless redirects (Distance.zero()) stay legal. -
Sharpened
vo_public_raw_constructorcorrection message: now shows the concretethrow ArgumentError.value(...)guard shape inline and explicitly calls out that passthrough factories are rejected. Previous message ("expose a validated public factory") was too soft — LLMs ticked the "private redirect" box and added a passthrough, thinking the diagnostic was about naming. New message bakes the validation requirement into the example. Title rephrased from "Value Object raw constructors must be private" to "Value Object public factory must validate, not just forward." -
references/value-objects.mdForbidden section gains an explicit passthrough anti-pattern block + two corrective shapes: inline guards in the factory body, and an extracted_guard()helper (still passes the lint because the body is a function call, not bare arg). -
SKILL.mdCritical Rule 12 rewritten to require explicit guards in the public factory body and to call out passthrough as rejected. -
Skill doc fixes:
references/value-objects.mdForbidden section gains a Hive collision block + corrective shapes (Option A: entity stays primitive, VO via getter; Option B: separate persistence Model + domain Entity with mapper).references/hive-persistence.mdadds a VO Interop section, includes it in the Contents TOC, and corrects the@GenerateAdaptersexample to register persistence Models (UserModel/OrderModel) rather than domain entities. Aligns with the file's own Recap rule #3.SKILL.mdCritical Rule 12 gains a Hive collision caveat: do not change ctor param types on@GenerateAdapters-registered classes with shipped user data; expose VOs via entity getter instead.
-
Added three Value Object boundary rules in
lib/src/rules/value_object_source_rules.dart:vo_public_raw_constructor(ERROR): in/domain/values/, a redirecting factory of the formconst factory X.<name>(...) = _Impl;must use a private redirect name (._meters,._raw). Public callers skip validation otherwise — every VO must travel through a validated factory.domain_entity_primitive_factory(ERROR): in/domain/outside/domain/values/, a@freezedentity must not own named factories (factory User.fromPrimitives(...)). Primitive → VO conversion lives in data models, notifiers, or import services so the entity remains unrepresentable in invalid state.domain_custom_copy_with(ERROR): no hand-writtencopyWithin/domain/. Let Freezed generate it from the redirect — drift between author intent and generated semantics (nullability, sentinels, equality) silently breaks callers otherwise.
-
Cross-references SKILL.md Critical Rule 12 and
references/value-objects.md.
0.5.6 - 2026-05-13 #
- Rewrote
arch_domain_importcorrection message to guide users toward Value Objects (sealed Freezed class in/domain/values/) for shared primitive logic and entity getters for one-off derivations. Old message ("Move Flutter/package dependencies out of domain entities") was misleading — pure-Dartcore/extensions/imports are also blocked, by design. Cross-references SKILL.md Critical Rules 11 and 12.
0.5.5 - 2026-05-12 #
- Added
avoid_run_zoned_guarded(AST rule) to flagrunZonedGuarded(...)calls. Per Flutter 3.3+ guidance (docs.flutter.dev/testing/errors), replace with the three-hook pattern:FlutterError.onError,PlatformDispatcher.instance.onError, andIsolate.current.addErrorListener.runZonedGuardedmisses platform-channel async errors. Catches direct calls and aliasedimport 'dart:async' as a;calls. Complements the existingcrash_run_zoned_guarded_legacyscanner rule (which permits a "legacy" escape hatch); enableavoid_run_zoned_guardedfor a hard ban. - Registered a quick-fix that rewrites
runZonedGuarded(body, onError)into the canonical three-hook scaffold + inlined body. The fix infers the reporter call from the originalonErrorbody (defaults toprintwhen unknown). User customizes the reporter after applying. - Added
require_main_error_hooksrule. Any top-level function whose body callsrunApp(...)must wire all three hooks. Coversmain()AND bootstrap wrappers (e.g.runRepem,bootstrap,mainCommon). Escape hatch: add// flutter_skill_lints:configure_error_hooks_elsewhereinside the body to opt out when hooks live in an extracted helper. - Bumped Flutter skill rule count to 110 and diagnostic count to 117.
0.5.4 - 2026-05-12 #
- Added
router_gorouter_ofto flagGoRouter.of(context).{go,push,replace, pushReplacement,goNamed,pushNamed,replaceNamed}calls. Typed routes (const FooRoute(...).push<T>(context)/.go(context)) are the SSOT for navigation — they survive route renames and stay refactor-safe. - Added
router_untyped_navigator_pushto flagNavigator.{push,pushReplacement,pushAndRemoveUntil}(incl.Navigator.of(context).…) when paired withMaterialPageRoute,CupertinoPageRoute, orPageRouteBuilder. Use a typed@TypedGoRoutethenconst FooRoute(...).push<T>(context). - Bumped Flutter skill rule count to 108 and diagnostic count to 115.
- Refreshed README example,
doc/building-flutter-apps-lint-coverage.md, andreferences/common-patterns.mdCritical Rules + Navigation anti-pattern block.
0.5.3 - 2026-05-12 #
- Added
riverpod_feature_notifier_keepaliveto flag non-family feature presentation notifiers that auto-dispose without an explicit ephemeral-state rationale. - Extended the gated plugin smoke to assert the new diagnostic in a temporary Flutter app loaded through the Dart analyzer plugin system.
0.5.2 - 2026-05-12 #
- Added
avoid_mounted_check_in_finallyto flagif (!ref.mounted) return;(andcontext.mounted/ baremounted) shapes insidefinallyblocks.return;infinallyswallows in-flight exceptions from thetrybody. Ships a quick-fix that rewrites the early-return into anif (mounted) { ... }guard around the trailing statements. - Bumped additional analyzer rule count to 81 and quick-fix count to 64.
- Refreshed README counts and
doc/building-flutter-apps-lint-coverage.mdto list the new rule.
0.5.1 - 2026-05-11 #
- Removed stale
flutter_skill_lintsversion pins from README, example analysis options, and project-config test fixtures. The plugin block now matches the companion skill's unpinnedflutter_skill_lintssetup while keeping the documentedriverpod_lintprerelease pin. - Clarified that
dart analyzeis the analyzer/plugin gate and can report project-config drift through Dart analysis units, but does not replaceflutter pub getor pub.dev package validation for completepubspec.yamlchecks. - Refreshed coverage docs to the current registered surface: 105 Flutter-skill warning rules, 112 Flutter-skill diagnostic codes, 80 additional warning rules, 63 fixes, and 1 assist.
- Updated
flutter_skill_project_configwording from validation language to drift-reporting language; behavior is unchanged.
0.5.0 - 2026-05-11 #
- Added
router_complex_extrato flag GoRouter typed-route$extra,GoRouterState.extrareads, and directextra:navigation payloads. Route state must survive serialization, redirects, reloads, and modal pops; pass stable IDs or configure an explicitextraCodecinstead. - Bumped Flutter skill warning rule count to 105 and diagnostic code
count to 112, and refreshed README plus
doc/building-flutter-apps-lint-coverage.mdto list the new rule.
0.4.0 - 2026-05-10 #
- Added analyzer diagnostics for the remaining Dart-source drift checks:
riverpod_select_arrow_syntax,riverpod_mutation_experimental_warning,arch_repository_generated_extends,state_freezed_nullable_error, andcrash_run_zoned_guarded_legacy. - Tightened
riverpod_keepalive_familyso codegen family providers with positionalRef ref, valueparameters are reported, not only providers withrequirednamed parameters. - Added
riverpod_auto_dispose_keepalive_dependenciesto flag computed auto-dispose providers whose same-file watched dependencies are all knownkeepAlive, matching thebuilding-flutter-appsprovider decision tree. - Allowed documented
@Riverpod(keepAlive: true)family workarounds for the open Riverpod TickerMode assertion issuerrousselGit/riverpod#4709. - Added extra false-positive coverage for non-Riverpod
selectAPIs, keep-alive providers without family arguments, generated notifier classes, Riverpod-generated provider classes named*Repository, Freezed DTOs with nullable error fields, non-notifier/qualifiedMutation<T>usages,Mutation<T>declarations, andrunZonedGuardeddeclarations/comments. - Documented that non-Dart drift checks remain owned by
check_drift.sh/CI because analyzer plugin diagnostics attach to Dart analysis units.
0.3.0 - 2026-05-10 #
- Expanded the Flutter skill analyzer surface with extended architecture, Freezed, routing, ShowcaseView, Flutter optimization, persistence, crash reporting, service, mixin, state, UI, and test diagnostics.
- Added
use_unawaited_for_fire_and_forget_futuresand broadened project configuration checks for analyzer plugins, strict analysis, generated-file excludes, Freezed annotation ignores,explicit_to_json, prohibited lint plugin dependencies, and deterministic Flutter Driver entrypoints. - Tightened migrated
many_lints-style coverage with additional false-positive tests, source scanner regression tests, and updated rule registration. - Refreshed README rule counts, example configuration, and lint coverage documentation for the expanded diagnostic set.
0.2.0 - 2026-05-07 #
- Documentation pass: rewrote
README.mdfor faster onboarding, added a Quick Start with copy-pasteanalysis_options.yaml, a tighter rule-group table, and a Troubleshooting section. - Fixed the license badge link in the README.
0.1.1 - 2026-05-07 #
- Added
avoid_constant_switches, a dead-logic warning forswitchstatements and expressions that switch on literals, const variables, or static const fields. - Added automatic release tagging after successful
mainCI, followed by tag-based pub.dev publishing and GitHub Release creation. - Split the migrated scanner surface into one registered analyzer rule per
diagnostic ID, matching
many_lints' specific rule-registration style. - Re-ran the
many_lints 0.4.0inventory audit, added the remaining allowed rules frommany_lints, includingprefer_class_destructuring, and kept the configured false-list diagnostics, including Cubit suffix checks, out of the default Flutter skill profile.
0.1.0 - 2026-05-06 #
- Initial analyzer plugin scaffold.
- Added Flutter skill rules for Riverpod async safety, mounted guards,
legacy Riverpod APIs, dynamic/null-bang usage, widget helper methods,
shrinkWrap, GoRouter pop guards, Freezed class shape, showcase key filtering, route-param throws, repository initialization, and synchronous notifier initialization. - Added additional Dart/Flutter analyzer coverage inspired by
many_lints: 79 default warning rules, 61 fixes, and 1 assist. - Added migrated Dart-source checks from the Flutter skill scanner.
- Added
flutter_skill_project_configso stale analyzer configuration andbuild.yamlJSON settings report through analyzer diagnostics. - Added a gated Flutter integration smoke with
riverpod_lint 3.1.4-dev.3.