prefer_relative_imports

Group: errors

Maturity: stable

Dart SDK: >= 2.6.0-dev.5.0 • (Linter v0.1.99)

Since info is static, may be stale
effective dart

View all Lint Rules

Using the Linter

Prefer relative imports for files in lib/.

When mixing relative and absolute imports it's possible to create confusion where the same member gets imported in two different ways. One way to avoid that is to ensure you consistently use relative imports for files withing the lib/ directory.

GOOD:

import 'bar.dart';

BAD:

import 'package:my_package/bar.dart';