Skip to content
pubscout

architecture_linter

0.3.0, released 2 years ago by iteo.com

Architecture linter plugin that enforces layer boundaries and banned imports via analyzer rules

$ flutter pub add architecture_linter
Source repository

What it does

It analyzes Dart/Flutter projects to detect architectural violations such as improper imports between layers. The plugin reports lints in IDEs and can exit with a code based on severity.

AI-written summary of version 0.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to enforce a strict layered architecture in a large codebase
  • You want automated linting for import rules and layer configuration
  • You prefer configuration over code generation

Skip it when

  • Your project has a very flat structure with no layers
  • You need runtime enforcement rather than static analysis

Strengths

  • Configurable via YAML, supports custom layer paths and severities
  • CLI support for CI pipelines
  • Integrates with existing analyzer plugins
  • No build_runner or code generation required

Weaknesses

  • Only works with Dart/Flutter analyzer, not for other languages
  • Requires manual YAML configuration
  • No UI component, purely linting

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
8

Add to dev_dependencies, configure analysis_options.yaml, run analyzer or CLI

```yaml
architecture_linter:
  layers:
    - name: "Domain"
      path: "(domain)"
    - name: "Presentation"
      path: "(presentation)"
  banned_imports:
    - layer: *presentationLayer
      banned:
        - *domainLayer
```

Alternatives

Packages that do the same job and could replace architecture_linter.

  • devtools_shared

    Shared Dart structures and server classes between devtools_app and other tools.

  • pubviz

    A tool to visualize package dependencies and version constraints in your Dart project.

  • ambilytics

    Google Analytics wrapper for all Flutter platforms including Windows and Linux

  • flutter_automation

    Provides command line automation scripts to help setup aspects of a Flutter project.

Works with

Packages commonly used together with architecture_linter: ones it builds on, ones built on it, and its own family.