Skip to main content

prefer-pinned-version-syntax

added in: 1.22.0
Pro+

Warns when a dependency version is not specified as the exact version (e.g. 1.2.3).

Using exact dependency versions helps you control how and when you update your external dependencies.

Example

❌ Bad:

pubspec.yaml
name: some_package
description: ...
version: 1.0.0

dependencies:
some_dependency: ^1.0.0 # LINT: Specify the version as '1.2.3'.

✅ Good:

pubspec.yaml
name: some_package
description: ...
version: 1.0.0

dependencies:
some_dependency: 1.0.0

Additional Resources