lint_strict_dependencies

Simple linter of strict dependencies for Flutter apps.

Usage

Install

dev_dependencies:
  lint_strict_dependencies: any

Config

To use lint_strict_dependencies, you need adding setting to your strict_dependencies.yaml.

rules:
  - module: "ui/components"
    allowReferenceFrom:
      - "ui/pages"
    allowSameModule: true
  - module: "view_models"
    allowReferenceFrom:
      - "ui/pages"
    allowSameModule: false
  - module: "models"
    allowReferenceFrom:
      - "view_models"
      - "ui/pages"
    allowSameModule: false

Execute lint

flutter pub run lint_strict_dependencies:main

Libraries

file_entity
file_linter
line_linter
lint_config
lint_error
list_files