avoid_relative_lib_imports

Group: errors

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.44)

pedantic

View the Project on GitHub dart-lang/linter

DO avoid 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. An easy way to avoid that is to ensure you have no relative imports that include lib/ in their paths.

GOOD:

import 'package:foo/bar.dart';

import 'baz.dart';

...

BAD:

import 'package:foo/bar.dart';

import '../lib/baz.dart';

...