搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫CQLabs/dart-code-metrics-presets

dart-code-metrics-presets

DCM 的預設設定

dart-code-metrics-presets 專案封面
星標
10
分支
5
最近推送(UTC)
2026年8月18日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

Pub Version License package publisher

DCM Presets

DCM is an advanced linter for Dart and Flutter that helps you analyze and improve your code quality. You can find all available lint rules here.

This repository contains a list of predefined DCM presets for lints:

  • All: contains all available lint rules for Dart and Flutter.
  • Recommended: contains recommended Dart and Flutter rules (with an emphasis on finding errors).
  • Dart: contains all lint rules applicable to any Dart app.
  • Flutter: contains all lint rules applicable to any Flutter app.
  • Pub: contains all lint rules for linting the pubspec.yaml files.
  • Flame: contains all lint rules for the Flame package.
  • Provider: contains all lint rules for the Provider package.
  • Bloc: contains all lint rules for the Bloc package.
  • Riverpod: contains all lint rules for the Riverpod package.
  • Equatable: contains all lint rules for the Equatable package.
  • Patrol: contains all lint rules for the Patrol package.
  • FakeAsync: contains all lint rules for the FakeAsync package.
  • Mocktail: contains all lint rules for the Mocktail package.
  • GetIt: contains all lint rules for the GetIt package.
  • JsonSerializable: contains all lint rules for the JsonSerializable package.
  • FlutterHooks: contains all lint rules for the FlutterHooks package.
  • FirebaseAnalytics: contains all lint rules for the FirebaseAnalytics package.
  • GetX: contains all lint rules for the GetX package.
  • Intl: contains all lint rules for the Intl package.
  • EasyLocalization: contains all lint rules for the EasyLocalization package.

and for metrics:

  • All Metrics: contains all available metrics with recommended default thresholds.
  • Recommended metrics: contains recommended metrics with default thresholds.

How to use a preset

Take these steps to enable a preset:

  1. Install this package as a dev dependency:

    dart pub add --dev dart_code_metrics_presets
    

    or:

    flutter pub add --dev dart_code_metrics_presets
    
  2. For DCM configuration add the extents entry:

    dart_code_metrics:
      extends:
        - package:dart_code_metrics_presets/all.yaml
    

Disabling or reconfiguring a rule from the preset

To disable a rule, simply set its value to false:

dart_code_metrics:
  extends:
    - package:dart_code_metrics_presets/all.yaml
  rules:
    - avoid-banned-imports: false

To reconfigure a rule, that is included into a preset:

dart_code_metrics:
  extends:
    - package:dart_code_metrics_presets/all.yaml
  rules:
    - arguments-ordering:
        child-last: true

Defining a custom preset

Any other preset can be passed to the extends entry. To create a custom preset create a yaml file with the same structure as for regular DCM configuration.

Code Quality Labs GitHub avatar
GitHub 作者

Code Quality Labs ↗

分類

此儲存庫發佈的套件

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗