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
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.
77Compare - pubviz
A tool to visualize package dependencies and version constraints in your Dart project.
74Compare - ambilytics
Google Analytics wrapper for all Flutter platforms including Windows and Linux
57Compare - flutter_automation
Provides command line automation scripts to help setup aspects of a Flutter project.
46Compare
Works with
Packages commonly used together with architecture_linter: ones it builds on, ones built on it, and its own family.
- analyzerarchitecture_linter depends on itPerforms static analysis of Dart code for tool integration and embedding.
- yamlarchitecture_linter depends on itA Dart library for parsing YAML documents into Dart data structures.
- globarchitecture_linter depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- argsarchitecture_linter depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- filearchitecture_linter depends on itPluggable, mockable file system abstraction for Dart with in-memory support.
- analyzer_pluginarchitecture_linter depends on itFramework for building plugins for the Dart analysis server