zeffya_lints 1.0.0 copy "zeffya_lints: ^1.0.0" to clipboard
zeffya_lints: ^1.0.0 copied to clipboard

Custom lints

zeffya_lints #

pub package GitHub license GitHub stars

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.