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.
Libraries
- rules/class_member_order/class_member_order_functions
- rules/class_member_order/class_member_order_quick_fix
- rules/class_member_order/class_member_order_rule
- rules/class_member_order/class_member_type
- rules/constructor_parameter_order/constructor_parameter_order_functions
- rules/constructor_parameter_order/constructor_parameter_order_quick_fix
- rules/constructor_parameter_order/constructor_parameter_order_rule
- rules/constructor_parameter_order/constructor_parameter_type
- rules/control_flow_spacing/control_flow_spacing_quick_fix
- rules/control_flow_spacing/control_flow_spacing_rule
- zeffya_lints