coolint 2.1.2 copy "coolint: ^2.1.2" to clipboard
coolint: ^2.1.2 copied to clipboard

Recommended lints for cool apps, packages, and plugins to encourage good coding practices.

coolint #

Pub Version Pub Likes Pub Points Pub Downloads Dart SDK Version

An opinionated and strict set of lint rules for Dart and Flutter projects to enforce a clean, robust, and consistent codebase.


Why coolint? #

The Dart ecosystem provides a solid foundation for linting with package:lints. coolint builds on top of the recommended set of rules from package:lints and adds many more carefully selected rules to:

  • Prevent Common Errors: A wide range of rules to catch potential runtime errors during static analysis.
  • Enforce a Consistent Style: Keep your codebase looking clean and uniform, no matter how many developers are working on it.
  • Promote Best Practices: Encourage the use of modern and performant Dart features.
  • Improve Readability: A well-linted codebase is easier to read, understand, and maintain.

Getting Started #

1. Add dependency #

Add coolint to your pubspec.yaml file under dev_dependencies.

dev_dependencies:
  coolint: ^2.1.1 # Make sure to use the latest version

2. Configure analysis_options.yaml #

coolint provides two sets of rules: one for pure Dart projects and one for Flutter projects.

For Flutter Projects

Include the Flutter ruleset in your analysis_options.yaml file. This includes all the Dart and Flutter specific rules.

include: package:coolint/flutter.yaml

Note: For backward compatibility, you can also use include: package:coolint/coolint.yaml, which is the same as flutter.yaml.

For Pure Dart Projects

If you are working on a pure Dart project (e.g., a command-line tool or a server-side application), you can use the Dart-only ruleset.

include: package:coolint/dart.yaml

That's it! The Dart analyzer will now use the selected rules from coolint.

Philosophy #

The philosophy of coolint is to be strict but pragmatic. The rules are designed to be strict enough to prevent common pitfalls and ensure high code quality, but not so strict that they become a burden or hinder productivity.

This package is ideal for teams and individuals who want to maintain a high standard of quality in their Dart and Flutter projects.

Show your support #

If you use coolint in your project and you like it, you can show your support by adding one of these badges to your README.md:

linted by coolint linted by coolint

How to add #

To include a badge in your project:

  1. Copy the Markdown code snippet for the badge you want.
  2. Paste it into your project’s README.md file.

Markdown:

[![](https://img.shields.io/badge/linted%20by-coolint-0553B1)](https://pub.flutter-io.cn/packages/coolint)

Markdown (for-the-badge style):

[![](https://img.shields.io/badge/linted%20by-coolint-0553B1?style=for-the-badge)](https://pub.flutter-io.cn/packages/coolint)

Contributing #

Contributions are welcome! If you have a suggestion for a new rule, or you want to improve the existing set, please open an issue or a pull request on our GitHub repository.

License #

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.

4
likes
150
points
220
downloads

Publisher

verified publisheryaminokishi.com

Weekly Downloads

Recommended lints for cool apps, packages, and plugins to encourage good coding practices.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#analysis #lints

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on coolint