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) {}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.