flow
द्वारा facebook
React कोड के लिए DOM और नेटिव प्लेटफ़ॉर्म पर स्टैटिक टाइप चेकिंग। चार रेंडरर विकल्प मानक DOM, ब्राउज़र-विशिष्ट कोड, React Native और Fabric वातावरण को कवर करते हैं। वैकल्पिक रेंडरर आर्गुमेंट के साथ yarn flow चलाएं; व्यापक लेकिन धीमी जांच के लिए yarn flow-ci का उपयोग करें। फ़ाइल स्थानों के साथ टाइप त्रुटियों की रिपोर्ट करता है ताकि समस्याओं को जल्दी पहचाना और ठीक किया जा सके। सामान्य नुकसानों पर ध्यान दें: लापता
npx skills add https://github.com/facebook/react --skill flowFlow Type Checking
Arguments:
- $ARGUMENTS: Renderer to check (default: dom-node)
Renderers
| Renderer | When to Use |
|---|---|
dom-node | Default, recommended for most changes |
dom-browser | Browser-specific DOM code |
native | React Native |
fabric | React Native Fabric |
Instructions
- Run
yarn flow $ARGUMENTS(usedom-nodeif no argument) - Report type errors with file locations
- For comprehensive checking (slow), use
yarn flow-ci
Common Mistakes
- Running without a renderer - Always specify or use default
dom-node - Ignoring suppressions - Check if
$FlowFixMecomments are masking real issues - Missing type imports - Ensure types are imported from the correct package