An opinionated and automated linter for enforcing a strict Clean Architecture in Dart & Flutter projects.
This workspace is a monorepo managed by Melos and contains the core linter package, a support library, and an example project.
clean_architecture_kit is a powerful custom linting package that integrates directly into the Dart analyzer. It helps you and your team maintain architectural boundaries automatically by providing compile-time warnings and errors for common violations.
- Automated & Unobtrusive: Get real-time feedback in your IDE without any external tools.
- Highly Configurable: Tailor the rules, directory names, and naming conventions to match your project's specific needs.
- Intelligent Quick Fixes: Go beyond just finding problems. The linter can generate boilerplate code for you, such as creating UseCases and
toEntity()mapping methods.
| Package | Description | Version |
|---|---|---|
packages/clean_architecture_kit |
The main linter package. This is what you'll add to your pubspec.yaml. |
|
packages/clean_architecture_core |
A lightweight, optional support package providing base classes (Repository, UseCase, etc.) that work with the linter out-of-the-box. |
|
example |
An example Flutter project demonstrating all the lints and quick fixes in action. | N/A |
To use the linter in your own project, please see the detailed instructions in the clean_architecture_kit README.
This project is managed with Melos. To get started as a contributor:
-
Activate Melos:
dart pub global activate melos
-
Bootstrap the Workspace: This links all the local packages together.
melos bootstrap
-
Run Tests:
melos run test -
Analyze the Example Project: To see the lints in action while developing, run the analyzer on the example app.
melos run analyze:example