simple_ directive_ paths
Details about the 'simple_directive_paths' diagnostic produced by the Dart analyzer.
Use simple directive paths.
Description
#
The analyzer produces this diagnostic when a directive uses a path that is
not simple (for example, a path containing redundant ./ or backtracking
../ segments).
Example
#Given a file named bar.dart in the lib/src directory:
class Bar {}
The following code produces this diagnostic because it uses an unnecessarily complex relative URI:
import './src/bar.dart';
void f(Bar b) {}
Common fixes
#Use a minimal relative URI:
import 'src/bar.dart';
void f(Bar b) {}
Unless stated otherwise, the documentation on this site reflects Dart 3.11.0. Report an issue.