跳到主要内容

sort_pub_dependencies

稳定

按字母顺序排序 pub 依赖项。

详情

#

请在 pubspec.yaml 中按字母顺序 (A 到 Z) 排序 pub 依赖项。

对 pub 依赖项列表进行排序使维护更容易。

启用

#

要启用 sort_pub_dependencies 规则,请在您的 analysis_options.yaml 文件中的 linter > rules 下添加 sort_pub_dependencies

analysis_options.yaml
yaml
linter:
  rules:
    - sort_pub_dependencies

如果您改为使用 YAML 映射语法配置 linter 规则,请在 linter > rules 下添加 sort_pub_dependencies: true

analysis_options.yaml
yaml
linter:
  rules:
    sort_pub_dependencies: true