This project was laid out in a way that makes it easy to contribute. Here are some guidelines to follow:
- Fork the repository
- Follow the Naming conventions for new rules
- Add your rule to the
lib/src/rules
directory - Add your rule to the
lib/src/accessibility_lint.dart
file - Add a valid test on the
example/lib/main.dart
file (You can reference the other rules) - Add the rule to the
README.md
features section
- The rule name should be in
snake_case
- The rule name should start with
avoid_
oradd_
- The rule name should be descriptive
- The rule name should be in English
After you have added your rule, open a pull request with the following information:
- The rule name
- The rule description
- Why the rule is important
- An example of the rule in action
- The rule severity
You can use this template:
## Rule name
- **Description**: A brief description of the rule
- **Why it's important**: Why this rule is important
- **Example**:
```dart
// expect_lint: avoid_icon_button_without_tooltip
IconButton(
icon: Icon(Icons.add),
onPressed: () {},
)
```
- **Severity**: `Severity.warning` or `Severity.error`
To test your rule, run the following command:
dart pub run custom_lint