Skip to content

Files

Latest commit

 

History

History
26 lines (17 loc) · 579 Bytes

prefer_relative_imports.md

File metadata and controls

26 lines (17 loc) · 579 Bytes

Pattern: Missing use of relative import

Issue: -

Description

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.

Example of correct code:

import 'bar.dart';

Example of incorrect code:

import 'package:my_package/bar.dart';

Further Reading