package.json: Add flow check commands for iOS and Android (#21326)

Summary:
This PR adds these two scripts to `package.json`:

 * `flow-check-ios` - for running `flow check` on `.ios.js` files
 * `flow-check-android` - for running `flow check` on `.android.js` files

The Android command makes use of the new `--flowconfig-name` option added to Flow in `0.80.0`
Pull Request resolved: https://github.com/facebook/react-native/pull/21326

Differential Revision: D10055702

Pulled By: hramos

fbshipit-source-id: e647f8d2995da0a9bd6af242218819fd5745df63
This commit is contained in:
empyrical
2018-09-26 16:49:07 -07:00
committed by Facebook Github Bot
parent 2c1057062e
commit 99cacf4830
2 changed files with 11 additions and 4 deletions

View File

@@ -185,9 +185,13 @@ aliases:
name: Lint code
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/eslint/results.xml
- &run-flow-checks
name: Check for errors in code using Flow
command: yarn flow check
- &run-flow-checks-ios
name: Check for errors in code using Flow (iOS)
command: yarn flow-check-ios
- &run-flow-checks-android
name: Check for errors in code using Flow (Android)
command: yarn flow-check-android
- &run-sanity-checks
name: Sanity checks
@@ -377,7 +381,8 @@ jobs:
at: ~/react-native
- run: *run-lint-checks
- run: *run-flow-checks
- run: *run-flow-checks-ios
- run: *run-flow-checks-android
- store_test_results:
path: ~/react-native/reports/junit

View File

@@ -126,6 +126,8 @@
"test": "jest",
"test-ci": "JEST_JUNIT_OUTPUT=\"reports/junit/js-test-results.xml\" jest --maxWorkers=2 --ci --testResultsProcessor=\"jest-junit\"",
"flow": "flow",
"flow-check-ios": "flow check",
"flow-check-android": "flow check --flowconfig-name .flowconfig.android",
"lint": "eslint .",
"prettier": "prettier \"./**/*.js\" --write",
"docker-setup-android": "docker pull reactnativeci/android-base:latest",