leancode_lint 20.0.2
leancode_lint: ^20.0.2 copied to clipboard
Robust and high-quality lint rules used at LeanCode.
leancode_lint Examples #
Default configuration #
# pubspec.yaml
dev_dependencies:
leancode_lint: ^20.0.0
# analysis_options.yaml
include: package:leancode_lint/analysis_options.yaml
plugins:
leancode_lint: ^20.0.0
From this repo (path dependency):
dev_dependencies:
leancode_lint:
path: ../..
plugins:
leancode_lint:
path: ../..
Custom configuration #
-
Create a plugin package (e.g.
my_lints) that depends onleancode_lintand exposes aplugin:// my_lints/lib/main.dart import 'package:leancode_lint/plugin.dart'; final plugin = LeanCodeLintPlugin( name: 'my_lints', config: LeanCodeLintConfig( catchParameterNames: CatchParameterNamesConfig( exception: 'error', stackTrace: 'stackTrace', ), ), ); -
Add the plugin as a dev dependency and enable it:
# pubspec.yaml dev_dependencies: my_lints: path: ./path/to/my_lints # analysis_options.yaml include: package:leancode_lint/analysis_options.yaml plugins: my_lints: path: ./path/to/my_lints
Running #
cd example/default && flutter pub get && flutter analyze
cd example/custom/app && flutter pub get && flutter analyze