surf_dcm_presets 0.0.4 copy "surf_dcm_presets: ^0.0.4" to clipboard
surf_dcm_presets: ^0.0.4 copied to clipboard

Predefined presets for Dart Code Metrics.

Surf DCM Presets #

Made by Surf 🏄‍♂️🏄‍♂️🏄‍♂️

Build Status Pub Version Pub Likes Pub popularity Flutter Platform

Overview #

This repository contains a list of pre-set presets for DCM that are used on Surf projects:

  • All: contains all available lint rules.
  • Dart: contains all lint rules applicable to any Dart app.
  • Flutter: contains all lint rules applicable to any Flutter app.
  • Provider: contains all lint rules for the Provider package.
  • Intl: contains all lint rules for the Intl package.
  • Pub: contains all lint rules for linting the pubspec.yaml files.

Installation #

Take these steps to enable a preset:

Install this package as a dev dependency:

dart pub add --dev surf_dcm_presets

or:

flutter pub add --dev surf_dcm_presets

Example #

For DCM configuration add the extents entry:

dart_code_metrics:
  extends:
    - package:surf_dcm_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:surf_dcm_presets/all.yaml
  rules:
    - avoid-banned-imports: false

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

dart_code_metrics:
  extends:
    - package:surf_dcm_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.

How to reach us #

Please feel free to ask any questions about this package. Join our community chat on Telegram. We speak English and Russian.

Telegram