library_prefixes
Use lowercase_with_underscores
when specifying a library prefix.
This rule is available as of Dart 2.0.
Rule sets: recommended, flutter
Details
#DO use lowercase_with_underscores
when specifying a library prefix.
BAD:
dart
import 'dart:math' as Math;
import 'dart:json' as JSON;
import 'package:js/js.dart' as JS;
import 'package:javascript_utils/javascript_utils.dart' as jsUtils;
GOOD:
dart
import 'dart:math' as math;
import 'dart:json' as json;
import 'package:js/js.dart' as js;
import 'package:javascript_utils/javascript_utils.dart' as js_utils;
Usage
#To enable the library_prefixes
rule,
add library_prefixes
under linter > rules in your
analysis_options.yaml
file:
analysis_options.yaml
yaml
linter:
rules:
- library_prefixes
除非另有说明,文档之所提及适用于 Dart 3.5.4 版本,本页面最后更新时间: 2024-08-02。 查看文档源码 或者 报告页面问题。