-
Notifications
You must be signed in to change notification settings - Fork 31
Presets
Santiago Garcia Gil edited this page Sep 21, 2023
·
6 revisions
This project contains a list of predefined presets for DCL:
-
All: contains all available lint rules for Dart and Flutter.
- Dart: contains all lint rules applicable to any Dart app.
- Flutter: contains all lint rules applicable to any Flutter app.
- Recommended: contains recommended Dart and Flutter rules (with an emphasis on finding errors).
- Recommended metrics: contains recommended configured metrics.
- Flame: contains lint rules for the Flame package.
- Intl: contains lint rules for the Intl package.
Take these steps to enable a preset:
-
Install this package as a dev dependency:
dart pub add --dev dart_code_linter
or:
flutter pub add --dev dart_code_linter
-
For DCL configuration add the
extents
entry:dart_code_linter: extends: - package:dart_code_linter/presets/all.yaml
To disable a rule, simply set its value to false:
dart_code_linter:
extends:
- package:dart_code_linter/presets/all.yaml
rules:
- avoid-banned-imports: false
To reconfigure a rule, that is included into a preset:
dart_code_linter:
extends:
- package:dart_code_linter/presets/all.yaml
rules:
- arguments-ordering:
child-last: true
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 DCL configuration.