flow
작성자: facebook
DOM 및 네이티브 플랫폼 전반의 React 코드에 대한 정적 타입 검사. 네 가지 렌더러 옵션은 표준 DOM, 브라우저별 코드, React Native 및 Fabric 환경을 포함합니다. 선택적 렌더러 인수와 함께 yarn flow를 실행하고, 포괄적이지만 느린 검사를 위해 yarn flow-ci를 사용합니다. 파일 위치와 함께 타입 오류를 보고하여 문제를 신속하게 식별하고 수정하는 데 도움을 줍니다. 일반적인 함정인 렌더러 지정 누락, 검사되지 않은 $FlowFixMe 억제, 잘못된 타입 임포트를 주의하세요.
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