d_rocket_lints 2.0.0
d_rocket_lints: ^2.0.0 copied to clipboard
Analyzer plugin rules for the d_rocket framework: detects closure LINQ calls (which run in-memory only and should be rewritten with Expr.lambda for SQL translation) and N+1 navigation fetches in loops.
Changelog #
All notable changes to d_rocket_lints are documented here.
The format follows Keep a Changelog.
2.0.0 — 2026-06-22 #
Breaking #
- Plugin host migration: switched from the archived
custom_lint_builder 0.8.x(maxanalyzer 8.0.0) to the officialanalysis_server_plugin 0.3.xfromtools.dart.dev.analyzeris bumped from^8.4.0to^10.0.1. This is the minimum to be on the same analyzer major asd_rocket_builder2.0.0. - SDK floor:
sdk: ^3.9.0(was^3.4.0). - Discovery: the
analyzer.plugins: [d_rocket_lints]block inanalysis_options.yamlreplaces the oldcustom_lint:block. The two are mutually exclusive. - Rule class names: the rule classes stayed in
src/lints/(no rename). The typedefsLinqClosureLint/NPlusOneLint(1.x names) are preserved for source compatibility. If you were importing the top-levellinq_closure_lint.dartorn_plus_one_lint.dartfiles (only relevant for plugin host testing), no import change is needed.
Added #
- 2 active rules at GA:
LinqClosureRule— detectsdbSet.where_(b => b.x == 1)style LINQ predicates that evaluate in-memory only and offers adart fixsuggestion to wrap the closure inExpr.lambda(...)for SQL translation.NPlusOneRule— detectsforloops overdbSet.where_(...).toList()that trigger an N+1 navigation fetch (one query per row, instead of oneIN (...)query).
- Golden test fixtures in
test/goldens/for both rules (positive + negative cases). dart fixsupport forLinqClosureRule.
Migration from 1.x #
# analysis_options.yaml — 1.x
analyzer:
plugins:
custom_lint:
- package:d_rocket_lints
# analysis_options.yaml — 2.0
analyzer:
plugins:
d_rocket_lints:
Removed (from 1.x) #
- The
lint_rule_test.dartdart fixgolden file forLinqClosureRule(the rule was promoted out of beta and the fix file was renamed for clarity). pub_workspace.darttest helper (was specific to thecustom_lint_builderhost and is no longer applicable).