lintforge 0.4.2 copy "lintforge: ^0.4.2" to clipboard
lintforge: ^0.4.2 copied to clipboard

LintForge is a pluggable static analysis tool for Dart and Flutter projects with an extensible runner, rule registry, and a standalone CLI you install globally.

Changelog #

Unreleased #

Changed #

  • Promoted unused_class to multi-file analysis so private class-like declarations can be kept alive by references from sibling part files while still reporting only on files eligible for diagnostics.
  • Narrowed unused_function conditional branch exemptions to public branch API, so private helpers in branch files can still be reported.
  • Suppressed unused_function local-function diagnostics nested inside an unused enclosing executable already reported by the rule.

Fixed #

  • Kept public enum constructors eligible for unused_function diagnostics when no enum value invokes them.

0.4.2 - 2026-07-09 #

Features #

  • unused_class: analyze across files (dd3d45f)

Bug Fixes #

  • cli: reject unknown rule ids (78516e5)
  • rules: report private extension members (dd18b3e)
  • rules: share generated file detection (f323009)
  • runner: match excludes from include roots (b08af2b)
  • samples: make samples pure Dart (cb0cba5)
  • unused_function: harden unused rule diagnostics (#55) (b92b0c1)
  • unused_function: narrow branch and nested diagnostics (ff4ca9f)
  • unused_function: report unused enum constructors (779ffec)
  • unused-function: exempt public constructors (57cbd0e)

0.4.1 - 2026-07-08 #

Bug Fixes #

  • unused_function: exempt freezed underscore constructors (c79c95c)
  • unused_function: exempt freezed underscore constructors (#52) (584e2c4)

0.4.0 - 2026-07-07 #

⚠ BREAKING CHANGES #

  • from dependency to standalone tool

Features #

  • cli: run lintforge as a standalone globally-activated tool (5377881)
  • cli: run lintforge as a standalone globally-activated tool (#49) (4f584c3)
  • from dependency to standalone tool (f65781e)

0.3.9 - 2026-07-04 #

Features #

  • cli: colorize output, align findings, and show live progress (7b6ee95)
  • cli: colorize output, align findings, and show live progress (#46) (b51c75d)

0.3.8 - 2026-05-29 #

Features #

  • cli: add --list-rules option to print registered rules (fdcd0e4)
  • cli: add --list-rules option to print registered rules (#31) (2761611)
  • hardening unused functions (#35) (251e696)
  • unused_function: exempt constructors of freezed-annotated classes (ff79b39)
  • unused_function: exempt constructors of freezed-annotated classes (#34) (1ef7ca2)
  • unused: suppress nested findings inside unused source files (c972e32)
  • unused: suppress nested findings inside unused source files (#36) (4a84f2c)

Bug Fixes #

  • runner: exclude .dart_tool/ and build/ from analysis by default (b3973b3)
  • runner: exclude .dart_tool/ and build/ from analysis by default (#33) (6456e5c)
  • unused_function: exempt conditional-export and public-API members (fdd67eb)
  • unused_function: exempt conditional-export/import branch targets (b7ad632)
  • unused_function: exempt public members of public types outside lib/src/ (e9de657)
  • unused_function: exempt supertype overrides without @override (dd40f83)

0.3.7 - 2026-05-28 #

Features #

  • better utilization coverage (#30) (1b86e8f)
  • multi_file_analysis_context: add reportableFilePaths field (6189773)
  • reporter: group ConsoleReporter output by file (8c4bba5)
  • reporter: group ConsoleReporter output by file (#28) (1880d63)
  • samples: exercise excluded-file references in samples (9f3301c)
  • unused_function: only emit diagnostics for reportable files (2c6ee3e)
  • unused_source_file: only flag reportable files (13ad2ee)

0.3.6 - 2026-05-28 #

Features #

  • function analysis enhanced (#26) (b0538b9)
  • unused_function: normalise generic member identity in reference tracking (c19c502)
  • unused_function: record enum-value declarations as uses of the enum constructor (b592b78)
  • unused_function: record implicit super-constructor invocation as a use (ee2a5c1)
  • unused_function: treat overrides of reachable supertype members as uses (c9f3c0e)
  • unused_function: walk supertype chain for noSuchMethod exemption (a85e7e2)

Bug Fixes #

  • unused_function: exempt flutter gen-l10n generated localization output (0c06c1f)

0.3.5 - 2026-05-28 #

Features #

  • dart awareness (#24) (a966836)
  • unused_class: make rule Dart 3 feature-aware (bc6c086)
  • unused_function: make rule feature-aware (0ac7537)
  • unused_source_file: follow conditional and deferred import edges (7e1bc72)
  • updated sample (#21) (9d3e5b2)

Bug Fixes #

  • unused_source_file: follow conditional-URI branches when computing reachability (f7c1bb1)
  • unused_source_file: follow conditional-URI branches when computing reachability (#23) (ff720f2)

0.3.4 - 2026-05-27 #

Features #

  • sample projects (#17) (f120a92)
  • samples: add unused_source_file sample project (af01ba7)
  • unused functions (#20) (9f79e99)
  • unused_function: add collector for class, mixin, enum, and extension-type members (c5574f2)
  • unused_function: add collector for extension declaration members (ffa728a)
  • unused_function: add collector for top-level getters and setters (3d4d3e7)
  • unused_function: flag unreferenced public top-level functions in lib/src/ (07703ce)

Bug Fixes #

0.3.3 - 2026-05-27 #

Bug Fixes #

  • added nuances (35937b3)
  • rules: avoid UnsupportedError on namePart in unused_class (7c8acc8)

0.3.2 - 2026-05-27 #

Bug Fixes #

  • removed invalid version (67cdcac)

0.3.1 - 2026-05-27 #

Continuous Integration #

  • release: wire bin/lintforge.dart into release-please and trigger 0.3.1 (e544060)

0.3.0 - 2026-05-27 #

Added #

  • New default-on unused_source_file rule. It flags Dart source files in the analyzed set that are never reached from any entry point via an import, export, or part directive. Entry points are files under bin/ or test/, files that declare a top-level main, and lib/<package>.dart plus any other file sitting directly under lib/ (i.e. not nested inside lib/src/). Generated-file basenames such as *.g.dart and *.freezed.dart are skipped defensively even when the runner's default excludes are turned off. Diagnostics are emitted at Severity.warning. The rule is registered by the built-in CLI and enabled automatically. Running dart run lintforge against a project that previously produced no diagnostics may now surface new warnings from this rule.
  • New MultiFileAnalyzerRule extension point for custom rules that need to reason across multiple files in a single invocation (for example to build an import graph or a cross-file symbol index). Multi-file rules are registered with the same RuleRegistry as AnalyzerRule implementations and are dispatched once per run with the full set of resolved compilation units. Existing AnalyzerRule implementations continue to be dispatched once per file and do not need any changes.
  • New --no-default-excludes CLI flag that opts out of the built-in default exclude patterns. Pair it with explicit --exclude flags when you want full control over which paths are skipped.
  • New LintforgeOptions.defaultExcludePaths constant exposing the list of glob patterns excluded by LintforgeOptions.defaults(). Useful when composing custom LintforgeOptions instances programmatically.
  • New default-on unused_function rule. It flags file-local function declarations that are never referenced, specifically private top-level functions in libraries that have no part files and local function declarations inside another function or method body. Diagnostics are emitted at Severity.warning. The rule is registered by the built-in CLI and enabled automatically. Running dart run lintforge against a project that previously produced no diagnostics may now surface new warnings from this rule.
  • New default-on unused_class rule. It flags file-local declarations that are never referenced within the same compilation unit, covering class, mixin, enum, and extension type declarations whose names begin with _. The rule only runs against libraries that have no part files and skips declarations annotated with @pragma('vm:entry-point'). Diagnostics are emitted at Severity.warning. The rule is registered by the built-in CLI and enabled automatically. Running dart run lintforge against a project that previously produced no diagnostics may now surface new warnings from this rule.
  • Open-source project guidance, issue templates, pull request checklist, security policy, code of conduct, and Dependabot configuration.
  • Coverage artifact upload to CI.
  • .pubignore to keep automation and assistant-only files out of the published package archive.
  • .gitattributes for predictable text file line endings.

Changed #

  • Updated CI and release automation to target the repository default branch.
  • Tightened package metadata for pub.dev discovery.
  • Widened the analyzer dependency to >=9.0.0 <13.0.0 so projects using freezed >=3.2.5 can add lintforge without a version-solver conflict.
  • Default exclude patterns now include *.g.dart and *.freezed.dart. Pass an empty excludePaths (or --no-default-excludes on the CLI) to opt out.
  • --exclude now layers on top of the default excludes instead of replacing them. Patterns you pass are added to the built-in defaults; use --no-default-excludes if you need to suppress the defaults.

Fixed #

  • Fixed directory include discovery on Windows.
  • lintforge is now installable alongside freezed ^3.2.5.
  • dart run lintforge --version now prints the correct package version instead of the stale hardcoded 0.1.0.
  • Restored analyzer 9.0.0 compatibility for the unused_class rule. The rule previously reached into ExtensionTypeDeclaration.primaryConstructor, which only exists in analyzer 10+, causing a build break for consumers pinned to analyzer 9.0.0 ('primaryConstructor' isn't defined for the type 'ExtensionTypeDeclaration'). The rule now uses the cross-version ExtensionTypeDeclaration.name accessor.
  • unused_class no longer crashes on analyzer 9.x/10.x. The rule previously read ClassDeclaration.namePart and EnumDeclaration.namePart, which require the default-off experimental flag useDeclaringConstructorsAst = true and otherwise throw UnsupportedError, surfacing as Rule unused_class threw during analysis: .... The rule now uses the always-available name token on both nodes.

Commits #

0.2.0 - 2026-05-27 #

⚠ BREAKING CHANGES #

  • api: Calculator is removed from the public API.

Features #

  • add Severity, SourceLocation, Diagnostic value types (0b965cd)
  • api: re-export public surface from lib/lintforge.dart (4cef459)
  • cli: add bin/lintforge.dart CLI entry point (ae0fa3b)
  • frame basics (44c400e)
  • options: add LintforgeOptions value class (2c0cb6c)
  • reporter: add Reporter abstraction and ConsoleReporter (85e556d)
  • rules: add AnalyzerRule contract, AnalysisContext, RuleRegistry (0e45827)
  • rules: add unused_class rule (4adcd8e)
  • rules: add unused_function rule (84e9528)
  • rules: register unused_function rule in CLI (2ea76c1)
  • runner: add AnalysisRunner orchestrator and smoke test (b721079)

0.1.0 #

  • Added a pluggable static-analysis framework for Dart and Flutter projects:
    • AnalyzerRule: abstract plugin contract for custom rules.
    • Diagnostic, Severity, SourceLocation: value types describing analysis findings.
    • AnalysisContext: carrier passed into each rule invocation, exposing the resolved compilation unit.
    • RuleRegistry: in-memory registration and lookup of rules, with duplicate-id rejection.
    • AnalysisRunner: orchestrator that resolves target files, dispatches rules, and collects diagnostics.
    • LintforgeOptions: value class describing include/exclude paths and enabled rule ids.
    • Reporter / ConsoleReporter: pluggable diagnostic output, with a stdout implementation.
    • CLI executable lintforge (dart run lintforge) with --help, --version, --rules, and --exclude flags.

BREAKING CHANGE #

  • Removed the Calculator stub that shipped in 0.0.1. Consumers that depended on it must remove the import; it was a generator placeholder and not part of any intended public API.

0.0.1 #

  • Initial package scaffold.
0
likes
150
points
492
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

LintForge is a pluggable static analysis tool for Dart and Flutter projects with an extensible runner, rule registry, and a standalone CLI you install globally.

Repository (GitHub)
View/report issues
Contributing

Topics

#analyzer #cli #flutter #lint #static-analysis

License

MIT (license)

Dependencies

analyzer, args, glob, path

More

Packages that depend on lintforge