Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaboc/grab-lints
Lint rules to help avoid common misuse of Grab.
https://github.com/kaboc/grab-lints
flutter flutter-lint lint lint-rules
Last synced: 21 days ago
JSON representation
Lint rules to help avoid common misuse of Grab.
- Host: GitHub
- URL: https://github.com/kaboc/grab-lints
- Owner: kaboc
- License: mit
- Created: 2022-07-13T02:12:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-25T14:33:33.000Z (10 months ago)
- Last Synced: 2024-10-05T08:05:23.986Z (about 1 month ago)
- Topics: flutter, flutter-lint, lint, lint-rules
- Language: Dart
- Homepage: https://pub.dev/packages/grab_lints
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Pub Version](https://img.shields.io/pub/v/grab_lints)](https://pub.dev/packages/grab_lints)
Lint rules to warn you about common misuse of [Grab] and fix it quickly.
---
**This package is incompatible with grab 1.0.0-dev.1 and above.\
grab_lints is no longer necessary to avoid misuse related to the limitations
that existed in older versions of grab.**---
## Setup
This plugin uses [custom_lint](https://pub.dev/packages/custom_lint).
### pubspec.yaml
Put the latest version in place of `x.x.x` below.
```yaml
dev_dependencies:
custom_lint:
grab_lints: x.x.x
```### analysis_options.yaml
```yaml
analyzer:
plugins:
- custom_lint
```## Available lints
### Errors
| Rule | Fix | Details |
|--------------------|:---:|--------------------------------------------------------------------------------|
| missing_grab_mixin | ✅ | A necessary Grab mixin is missing in thewith
clause. |
| wrong_grab_mixin | ✅ | The widget class has a mismatching Grab mixin in thewith
clause. |### Warnings
| Rule | Fix | Details |
|------------------------------------|:---:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| unnecessary_grab_mixin | ✅ | An unnecessary Grab mixin is in thewith
clause. |
| maybe_wrong_build_context_for_grab | (✅) | TheBuildContext
passed to the grab method has either of the following issues:
- Not the one from the
build
method - Passed via a variable
BuildContext
parameter itself of the build
method should be directly used to avoid misuse or confusion.Quick fix is available only when an automatic fix is possible. |
| avoid_grab_outside_build | | A grab method has been used outside the
build
method of a widget.It is discouraged although using the method outside the
build
method is possible as long as the correct BuildContext
is used. Such usage easily leads to misuse or confusion. |
[Grab]: https://pub.dev/packages/grab