Skip to content

A collection of Lint rules for Dart and Flutter projects. Like Python flake8, but for Dart!

License

Notifications You must be signed in to change notification settings

silvaquill/flakes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The flakes package logo.

Flakes

A collection of Lint rules for Dart and Flutter projects. Like Python flake8, but for Dart!

  • Production ready
  • Strict but not annoying
  • Improve your code quality
  • Follow the Effective Dart Style

Installation

With Dart, install via dart pub:

dart pub add flakes

With Flutter, install via flutter pub:

flutter pub add flakes

Or manually add to your pubspec.yaml:

dev_dependencies:
  flakes: ^1.0.0

And run dart pub get or flutter pub get.

Usage

To use Flakes analysis, include the flakes.yaml file in your analysis_options.yaml:

include: package:flakes/flakes.yaml

You can also customize the rules or add your own:

include: package:flakes/flakes.yaml

linter:
  rules:
    # Customizing rules
    avoid_print: false

    # Adding rules
    public_member_api_docs: true

Integrations

To take advantage of Flakes in your CI, you can use dart fix to fix the lints automatically:

dart fix --dry-run # See what needs to be changed
dart fix --apply # Apply the changes

And if you're using VSCode, you can use the Dart Code extension to automatically fix the lints on save:

{
  "[dart]": {
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
      "source.fixAll": "explicit",
      "source.organizeImports": "explicit"
    }
  }
}

Note that not all lints can be fixed automatically, so you'll still need to fix some manually.


This package is inspired by other lint packages, like very_good_analysis and lint.

Developed with 💙 by Robson Silva.

About

A collection of Lint rules for Dart and Flutter projects. Like Python flake8, but for Dart!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages