Skip to main content

banned-dependencies

added in: 1.2.0
⚙️

Warns when a pubspec contains a banned dependency.

note

This rule requires configuration in order to highlight any issues.

⚙️ Config

Set banned (default is none) to configure the list of banned packages.

Set allowed (default is none) to configure the list of allowed packages.

dart_code_metrics:
...
pubspec-rules:
...
- banned-dependencies:
banned:
- get
- some_deprecated_package

Example

❌ Bad:

name: some_package
description: ...
version: 1.0.0

dependencies:
some_deprecated_package: 1.0.0 # LINT

✅ Good:

name: some_package
description: ...
version: 1.0.0