Aus öffentlichen Paketdaten erstellte Orientierung.
Eine Sammlung benutzerdefinierter Lint-Regeln für Flutter und Dart, speziell für die Open-Source-Projekte innerhalb der Flutterando-Community entwickelt. Diese Regeln fördern Konsistenz, Lesbarkeit und bewährte Praktiken im Code von Flutter-Anwendungen. Das Paket integriert sich nahtlos in das Dart-Analysetool und ist auf moderne Flutter-Entwicklungstandards abgestimmt. Es hilft dabei, hochwertige Codebasen zu erhalten, indem es communitygetriebene Richtlinien durchsetzt und häufige Probleme bereits früh im Entwicklungsprozess erkennt.
Anwendungsfälle
Konsistente Codierungsstil in Open-Source-Flutter-Projekten durchsetzen
Verbesserung der Codequalität durch communitygenehmigte Lint-Regeln
Standardisierte Überprüfungen in CI/CD-Pipelines integrieren
Unterstützung der einheitlichen Codebasis für das gesamte Team
Automatisches Erkennen von Anti-Patterns im Flutter/Dart-Code
Hauptmerkmale
community-getriebene Lint-Regeln
Speziell für Flutter- und Dart-Best Practices entwickelt
Einfache Integration über pub add
Kompatibel mit allen wichtigen Plattformen
Erweiterbare und wartbare Konfiguration
Geeignet für
Open Source Flutter-Entwickler
Teams, die große Flutter-Codebasen pflegen
Projekte mit dem Ziel hoher Codequalität
CI/CD-Umgebungen mit statischer Analyse
Entwickler, die den Coding-Standards von Flutterando folgen
Hinweise
Erfahrung mit der Dart-Linter-Konfiguration erforderlich
Möglicherweise ist eine Anpassung für nicht-Flutterando-Projekte erforderlich
Abhängig von korrekter Einrichtung in analysis_options.yaml
Nicht für die eigenständige Verwendung ohne zusätzliche Linter-Einrichtung vorgesehen
Am besten zusammen mit anderen Qualitätswerkzeugen wie flutter_lints verwendet
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
Flutterando Analysis
This package provides lint rules for Dart and Flutter which are used in
Flutterando's packages and projects. For more information, see the complete list of options.
Flutterando Analysis are a set of Flutter and Dart Lint rules that are the basis of our projects here at the community. They were inspired and selected from our work experience with other companies, and are backed up by several senior Flutter developers that can guarantee it's usefullness.
This project is distributed under the MIT License. See LICENSE.txt for more information.
To use our linter rules import it to your project like this:
a) Adding the package as a dependency in your Pubspec.yaml:
# Add it as a dev dependencydev_dependencies:flutterando_analysis:^0.0.2# Or as a normal dependency if you need todependencies:flutterando_analysis:^0.0.2
b) Alternatively, use Dart Pub. You can take out the tag --dev if you want to install as a normal dependency:
dart pub add --dev flutterando_analysis
After importing it, add an include in your project's analysis_options.yaml:
include:package:flutterando_analysis/flutter.yaml
or, for Dart:
include:package:flutterando_analysis/dart.yaml
There are 4 sets of linter rules that you can choose from:
dart.yaml
flutter.yaml
dart_package.yaml
flutter_package.yaml
(this second set has the rule "public_member_api_docs" set to True)
See also the analysis_options.0.0.1.yaml to know which rules we are using.
How To Suppress Lints
There may be cases where specific lint rules are undesirable. Lint rules can be suppressed at the line, file, or project level.
An example use case for suppressing lint rules at the file level is suppressing the prefer_const_constructors in order to achieve 100% code coverage. This is due to the fact that const constructors are executed before the tests are run, resulting in no coverage collection.
Line Level
To suppress a specific lint rule for a specific line of code, use an ignore comment directly above the line:
// ignore: public_member_api_docsclassA{}
File Level
To suppress a specific lint rule of a specific file, use an ignore_for_file comment at the top of the file:
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better or questions, please open an issue here, with the appropriate tag.
Don't forget to give the project a star! Thanks!