clean_architecture_linter 1.0.0 copy "clean_architecture_linter: ^1.0.0" to clipboard
clean_architecture_linter: ^1.0.0 copied to clipboard

retracted

A comprehensive custom lint package that automatically enforces Clean Architecture principles in Flutter projects with specialized rules.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.0.0 - 2025-10-09 #

πŸŽ‰ Initial Release #

A comprehensive custom lint package that automatically enforces Clean Architecture principles in Flutter/Dart projects.

✨ Added #

New Utility Infrastructure

  • CleanArchitectureUtils - Centralized utility class for common Clean Architecture validations
    • File path detection (isDomainFile, isDataFile, isPresentationFile)
    • Component detection (isUseCaseFile, isDataSourceFile, isRepositoryFile)
    • Class name validation (isUseCaseClass, isDataSourceClass, isRepositoryClass)
    • Type checking (isVoidType, isResultType)
    • Exception pattern recognition (isDataException, isDomainException)
    • AST utilities (findParentClass, isPrivateMethod, isRethrow)
    • Feature extraction (extractFeatureName)

New Mixin System

  • ExceptionValidationMixin - Exception naming and validation logic
  • ReturnTypeValidationMixin - Return type validation for methods
  • RepositoryRuleVisitor - Repository-specific validation

πŸ”„ Changed #

Code Organization

  • 170 lines removed (13.6% code reduction) through deduplication
  • Consolidated 13 rules to use shared mixins and utilities
  • Improved consistency across all validation logic
  • Enhanced test coverage with 76 comprehensive tests

Refactored All 24 Rules

All lint rules were refactored to leverage the new utility and mixin infrastructure:

Cross-Layer Rules (4)

  • LayerDependencyRule
  • CircularDependencyRule
  • BoundaryCrossingRule
  • TestCoverageRule

Domain Layer Rules (4)

  • DomainPurityRule
  • DependencyInversionRule
  • RepositoryInterfaceRule
  • UseCaseNoResultReturnRule
  • UseCaseMustConvertFailureRule
  • ExceptionNamingConventionRule
  • ExceptionMessageLocalizationRule

Data Layer Rules (7)

  • ModelStructureRule
  • DataSourceAbstractionRule
  • DataSourceNoResultReturnRule
  • RepositoryMustReturnResultRule
  • RepositoryNoThrowRule
  • DataSourceExceptionTypesRule
  • FailureNamingConventionRule

Presentation Layer Rules (6)

  • NoPresentationModelsRule
  • ExtensionLocationRule
  • FreezedUsageRule
  • RiverpodGeneratorRule
  • PresentationNoDataExceptionsRule
  • PresentationUseAsyncValueRule

πŸ“ˆ Improved #

Documentation

  • Added comprehensive ARCHITECTURE.md with system overview
  • Created CONTRIBUTING.md with development guidelines
  • Added RULE_DEVELOPMENT_GUIDE.md for contributors
  • Enhanced inline documentation across all files

Testing

  • 76 comprehensive tests covering all utilities and mixins
  • 100% coverage of utility methods
  • Extensive mixin behavior validation

Code Quality

  • Eliminated 170 lines of duplicate code
  • Consistent validation patterns across all rules
  • Improved error messages with better context
  • Enhanced maintainability through shared components

πŸ”§ Technical Details #

Dependencies

  • Dart SDK: ^3.6.0
  • analyzer: ^7.6.0
  • custom_lint_builder: ^0.7.6
  • path: ^1.9.1
1
likes
0
points
0
downloads

Publisher

verified publisherittae.com

Weekly Downloads

A comprehensive custom lint package that automatically enforces Clean Architecture principles in Flutter projects with specialized rules.

Repository (GitHub)
View/report issues

Topics

#clean-architecture #lint #custom-lint #linter #static-analysis

Documentation

Documentation

License

unknown (license)

Dependencies

analyzer, custom_lint_builder, path

More

Packages that depend on clean_architecture_linter