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:
constructorFieldconstructorstaticConststaticFinalstaticconstantlateFinalfinalVarlateVarvariableoptionalsettergetteroverrideMethodstaticMethodmethodprivateMethodwidgetOverrideBuildMethodwidgetBuildMethodnone
✅ ConstructorParameterOrderRule #
Ensures constructor parameters follow the desired order:
superFieldrequiredThisFieldrequiredVariablethisFieldthisFieldNullablevariableNullablethisFieldWithValuethisFieldNullableWithValuevariableWithValuenone
✅ 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.