zeffya_lints 1.0.0
zeffya_lints: ^1.0.0 copied to clipboard
Custom lints
zeffya_lints #
A custom set of linter rules to enforce consistent and clean Dart/Flutter code style.
π Features #
β
ClassMemberOrderRule
#
Enforces specific ordering and spacing between different groups of class members:
constructorField
constructor
staticConst
staticFinal
static
constant
lateFinal
finalVar
lateVar
variable
optional
setter
getter
overrideMethod
staticMethod
method
privateMethod
widgetOverrideBuildMethod
widgetBuildMethod
none
β
ConstructorParameterOrderRule
#
Ensures constructor parameters follow the desired order:
superField
requiredThisField
requiredVariable
thisField
thisFieldNullable
variableNullable
thisFieldWithValue
thisFieldNullableWithValue
variableWithValue
none
β
ControlFlowSpacingRule
#
Enforces spacing rules around control-flow statements such as if
, for
, while
, etc.
π¦ Installation #
Add the package to your dev_dependencies
:
dev_dependencies:
zeffya_lints:
custom_lint:
Then, in your analysis_options.yaml
, enable the plugin and optionally exclude generated files:
analyzer:
plugins:
- custom_lint
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
- "**/*.gr.dart"
- "lib/generated/**"
- "lib/firebase_options.dart"
Restart the Dart/Flutter analysis server after making changes to apply the new rules.
π License #
This project is licensed under the BSD 3-Clause License β see the LICENSE file for details.
Made with β€οΈ by zeffbtw.