https://github.com/robsonsilv4/flakes
A collection of Lint rules for Dart and Flutter projects. Like Python flake8, but for Dart!
https://github.com/robsonsilv4/flakes
analysis analyzer dart flutter linter lints
Last synced: 2 months ago
JSON representation
A collection of Lint rules for Dart and Flutter projects. Like Python flake8, but for Dart!
- Host: GitHub
- URL: https://github.com/robsonsilv4/flakes
- Owner: robsonsilv4
- License: mit
- Created: 2024-01-18T22:20:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-23T16:17:46.000Z (over 2 years ago)
- Last Synced: 2026-01-11T10:35:56.610Z (4 months ago)
- Topics: analysis, analyzer, dart, flutter, linter, lints
- Language: Dart
- Homepage: https://pub.dev/packages/flakes
- Size: 34.2 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flakes
A collection of [Lint](https://dart.dev/tools/linter-rules) rules for Dart and Flutter projects.
Like Python [flake8](https://flake8.pycqa.org/en/latest/), but for Dart!
- Production ready
- Strict but not annoying
- Improve your code quality
- Follow the [Effective Dart Style](https://dart.dev/guides/language/effective-dart/style)
## Installation
With Dart, install via `dart pub`:
```sh
dart pub add flakes
```
With Flutter, install via `flutter pub`:
```sh
flutter pub add flakes
```
Or manually add to your `pubspec.yaml`:
```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`:
```yaml
include: package:flakes/flakes.yaml
```
You can also customize the rules or add your own:
```yaml
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:
```sh
dart fix --dry-run # See what needs to be changed
dart fix --apply # Apply the changes
```
And if you're using [VSCode](https://code.visualstudio.com/), you can use the [Dart Code](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code) extension to automatically fix the _lints_ on save:
```json
{
"[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](https://pub.dev/packages/very_good_analysis) and [lint](https://pub.dev/packages/lint).
Developed with 💙 by [Robson Silva](https://github.com/silvaquill).