सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Flutter और Dart के लिए एक कस्टम लिंट नियमों का संग्रह, जो विशेष रूप से Flutterando समुदाय के ओपन सोर्स प्रोजेक्ट्स के लिए डिज़ाइन किया गया है। ये नियम Flutter एप्लिकेशन में कोड की सुसंगतता, पठनीयता और बेस्ट प्रैक्टिस को बढ़ावा देते हैं। पैकेज डार्ट एनालिसिस टूल के साथ बिना किसी दिक्कत के एकीकृत होता है और आधुनिक Flutter विकास मानकों का समर्थन करता है। यह समुदाय-चालित दिशानिर्देशों को लागू करके और विकास के शुरुआती चरण में सामान्य समस्याओं को पकड़कर उच्च गुणवत्ता वाले कोडबेस को बनाए रखने में मदद करता है।
उपयोग
ओपन सोर्स फ्लटर प्रोजेक्ट्स में सुसंगत कोडिंग शैली के लागू करना
समुदाय द्वारा मंजूर लिंटिंग नियमों के माध्यम से कोड गुणवत्ता में सुधार
CI/CD पाइपलाइन में मानकीकृत जाँचों का एकीकरण
टीम-वाइड कोडबेस एकरूपता का समर्थन करना
Flutter/Dart कोड में एंटी-पैटर्न का स्वचालित निर्देशन
मुख्य विशेषताएँ
समुदाय-नेतृत्व लिंट नियम
Flutter और Dart के सर्वोत्तम प्रथाओं के लिए अनुकूलित
pub add के माध्यम से आसान एकीकरण
सभी प्रमुख प्लेटफॉर्म के साथ सुगमता से चलता है
विस्तारयोग्य और बनाए रखने में आसान कॉन्फ़िगरेशन
इनके लिए उपयुक्त
ओपन सोर्स फ्लटर डेवलपर्स
बड़े फ्लटर कोडबेस का रखरखाव करने वाली टीमें
उच्च कोड गुणवत्ता के लिए लक्ष्य वाले प्रोजेक्ट
स्थिर विश्लेषण का उपयोग करते हुए CI/CD परिवेश
Flutterando के कोडिंग मानकों का पालन करने वाले डेवलपर्स
विचार योग्य बातें
Dart linter विन्यास की समझ की आवश्यकता है
गैर-Flutterando प्रोजेक्ट्स के लिए कस्टमाइज़ेशन की आवश्यकता हो सकती है
analysis_options.yaml में सही सेटअप पर निर्भर करता है
अतिरिक्त लिंटर सेटअप के बिना स्वतंत्र उपयोग के लिए नहीं बनाया गया है
अन्य गुणवत्ता उपकरणों के साथ उपयोग करने के लिए सबसे अच्छा, जैसे flutter_lints
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
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!