Skip to content

Commit 94717c1

Browse files
[RN] Make yarn the source of truth for JS lint/format
## Summary Point synced JavaScript formatting and linting at the repository's own Prettier + ESLint so CI is the source of truth: add `yarn f` (Prettier), expand the Prettier globs to all JS-family extensions, and make the CI ESLint step propagate its exit status instead of swallowing it. ## Changelog [Internal] ## Test Plan `yarn lint`, `yarn format-check`, and `yarn f` run from the repo root; the GitHub `lint` job runs both on this PR. Changelog: [Internal]
1 parent c7d62a1 commit 94717c1

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/test-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ jobs:
507507
run: yarn run lint-markdown
508508
- name: ESLint
509509
shell: bash
510-
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
510+
run: yarn lint
511511
- name: Flow
512512
shell: bash
513513
run: yarn flow-check

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
"cxx-api-validate": "python -m scripts.cxx-api.parser --validate",
1616
"flow-check": "flow full-check",
1717
"flow": "flow",
18-
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
19-
"format": "npm run prettier && npm run clang-format",
18+
"f": "yarn prettier",
19+
"format-check": "prettier --list-different \"./**/*.{cjs,cts,flow,js,jsx,md,mjs,mts,ts,tsx,yaml,yml}\"",
20+
"format": "yarn prettier && yarn clang-format",
2021
"featureflags": "yarn --cwd packages/react-native featureflags",
2122
"js-api-diff": "node ./scripts/js-api/diff-api-snapshot",
2223
"lint-kotlin-check": "./gradlew ktfmtCheck",
2324
"lint-kotlin": "./gradlew ktfmtFormat",
2425
"lint-markdown": "markdownlint-cli2 2>&1",
2526
"lint": "eslint --max-warnings 0 .",
2627
"preinstall": "node ./scripts/try-set-hermes-compiler-prebuilt.js",
27-
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
28+
"prettier": "prettier --write \"./**/*.{cjs,cts,flow,js,jsx,md,mjs,mts,ts,tsx,yaml,yml}\"",
2829
"shellcheck": "./.github/workflow-scripts/analyze_scripts.sh",
2930
"start": "yarn --cwd packages/rn-tester start",
3031
"set-version": "node ./scripts/releases/set-version.js",

0 commit comments

Comments
 (0)