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

KlinDart is a collection of opinionated custom lint rules for Dart and Flutter projects. It focuses on improving code **readability**, **maintainability**, and **scalability** by enforcing architectur [...]

๐Ÿง  KlinDart #

KlinDart is a collection of opinionated custom lint rules for Dart and Flutter projects. It focuses on improving code readability, maintainability, and scalability by enforcing architectural and stylistic best practices.

โœจ Features #

Rule Name Description
avoid_hardcoded_strings_in_ui Discourages hardcoded string literals directly inside widgets to improve localization readiness.
avoid_string_literals_in_logic Flags string literals used in conditions, comparisons, or logicโ€”suggests constants or enums instead.
cognitive_complexity Warns about methods/functions that are too complex to easily understand or maintain.
function_length Enforces a maximum function/method size to encourage smaller, testable units.
class_length Prevents overly long classes that may violate single-responsibility principle.
file_length Warns about files that exceed a configurable number of lines. Useful for splitting concerns.

๐Ÿš€ Installation #

To use KlinDart in your project:

1. Add dependency to your linter package #

# pubspec.yaml

dev_dependencies:
  custom_lint:
  klin_dart: <latest_version>

2. Enable it in analysis_options.yaml #

# analysis_options.yaml
analyzer:
  plugins:
    - custom_lint

custom_lint:

๐Ÿ“– Philosophy #

Clean code is not just about writing less code โ€” it's about writing the right code in the right place. KlinDart helps enforce practices that scale with your team, reduce bugs, and increase developer confidence across Dart and Flutter codebases. The rules are designed to be opinionated yet flexible, allowing you to adapt them to your project's specific needs.

๐Ÿ“Œ License #

This project is licensed under the MIT License. See the LICENSE file for details. MIT โ€” feel free to fork and adapt to your team's needs.

๐Ÿ‘ฅ Contributing #

We welcome contributions! If you have suggestions, bug reports, or feature requests, please open an issue or submit a pull request. Please ensure that your code adheres to the existing style and includes tests where applicable. We also encourage you to write documentation for any new features or changes you make.

2
likes
110
points
65
downloads

Publisher

unverified uploader

Weekly Downloads

KlinDart is a collection of opinionated custom lint rules for Dart and Flutter projects. It focuses on improving code **readability**, **maintainability**, and **scalability** by enforcing architectural and stylistic best practices.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, custom_lint_builder

More

Packages that depend on klin_dart