Skip to main content

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

Run linters on git staged files for your Flutter and Dart projects. Improved fork of lint_staged with JS lint-staged-style batched commands.

example/README.md

dart_lint_staged example #

Minimal setup: format and fix staged Dart files before each commit.

  1. Add the package:

    dart pub add --dev dart_lint_staged
    
  2. Configure commands in your pubspec.yaml:

    dart_lint_staged:
      'lib/**.dart': dart format && dart fix --apply
    
  3. Run it in your pre-commit hook (for example with Husky, in .husky/pre-commit):

    #!/usr/bin/env sh
    . "$(dirname "$0")/_/husky.sh"
    
    dart run dart_lint_staged
    

Stage a .dart file under lib/ and commit. The staged files are formatted and fixed, and the changes are added to the commit.

Do not pass file paths in the config. dart_lint_staged appends the staged files for you.

See the main README for all options.

0
likes
0
points
165
downloads

Publisher

unverified uploader

Weekly Downloads

Run linters on git staged files for your Flutter and Dart projects. Improved fork of lint_staged with JS lint-staged-style batched commands.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ansi, ansi_escapes, args, glob, path, verbose, yaml

More

Packages that depend on dart_lint_staged