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:
dart
class Bar {}
The following code produces this diagnostic because it uses an unnecessarily complex relative URI:
dart
import './src/bar.dart';
void f(Bar b) {}
Common fixes
#Use a minimal relative URI:
dart
import 'src/bar.dart';
void f(Bar b) {}
Was this page's content helpful?
除非另有说明,文档之所提及适用于 Dart 3.11.0 版本报告页面问题.