flutter_sane_lints 0.1.0 copy "flutter_sane_lints: ^0.1.0" to clipboard
flutter_sane_lints: ^0.1.0 copied to clipboard

A custom lint for flutter projects to avoid ad-hoc string literals.

Flutter Sane Lints #

style: very good analysis Powered by Mason License: MIT

A custom lint plugin to try and improve maintainability in Flutter projects by disallowing certain anti-patterns. At the moment, the only dart lint rule in this plugin is to avoid declaring ad-hoc strings inside Widget/State classes, or passing a literal to a Widget constructor.

Every String used for presentation (such as in a Text widget) should be defined in a l10n file. See Flutter Internationalization Tutorial.

Every String used for logic (such as in a switch statement) should be defined as an Enum or in any other way that makes sense for the use case while following good OO design. Using strings is a clear sign of primitive obsession and should be avoided.

Created with the Very Good CLI 💙

Installation 💻 #

❗ In order to start using Flutter Sane Lints you must have the Flutter SDK installed on your machine.

Add flutter_sane_lints and custom_lint to your pubspec.yaml:

dev_dependencies:
  custom_lint:
  flutter_sane_lints:

Install it:

flutter pub get

Usage 🚀 #

Add the custom_lint package to your analysis_options.yaml:

analyzer:
  plugins:
    - custom_lint

4
likes
0
points
148
downloads

Publisher

verified publisherel-darto.net

Weekly Downloads

A custom lint for flutter projects to avoid ad-hoc string literals.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, analyzer_plugin, custom_lint_builder, meta, source_gen

More

Packages that depend on flutter_sane_lints