Skip to content

Commit a693f41

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
fix(iOS): fix Prettier lint failure after SwiftPM support landed (#57564)
Summary: The OSS lint job went red after the SwiftPM stack landed (#57332 and its base PRs). The failing signal is the **Prettier** step of the `lint` job. The offending file (introduced in base PR #57442) is: `packages/react-native/scripts/ios-prebuild/__tests__/headers-xcframework-test.js` ```js let tmp /*: string */; ``` This is a Flow *comment-type annotation* on an **uninitialized** `let`. Prettier reformats an uninitialized declaration by moving the trailing comment past the semicolon: ```js let tmp; /*: string */ // annotation detached — no longer a type annotation ``` Because CI runs `prettier --list-different` (fails on any diff), this made the lint job fail. Prettier only keeps the `/*: string */` annotation inline when the declaration has an initializer, so the fix is to give `tmp` one: ```js let tmp /*: string */ = ''; ``` Semantically safe — `tmp` is assigned in `beforeEach` before any use. ## Changelog: [INTERNAL] [FIXED] - Fix Prettier lint failure in `headers-xcframework` test Pull Request resolved: #57564 Test Plan: - `yarn format-check` — clean across the repo - `yarn lint` (ESLint) — passes - `yarn lint-markdown` — passes - `yarn test-typescript-legacy` — passes - Jest `headers-xcframework-test.js` — all 5 tests pass Reviewed By: cortinico, fabriziocucci Differential Revision: D112114604 Pulled By: cipolleschi fbshipit-source-id: 9f2d116eae0cf5581cf0e1a1e79c0c3b28f7c176
1 parent 27b5f76 commit a693f41

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native/scripts/ios-prebuild/__tests__/headers-xcframework-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const os = require('os');
2020
const path = require('path');
2121

2222
describe('buildDepsHeadersXcframework set-equality gate', () => {
23-
let tmp /*: string */;
23+
let tmp /*: string */ = '';
2424
beforeEach(() => {
2525
tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'deps-headers-test-'));
2626
});

0 commit comments

Comments
 (0)