Commit a693f41
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: 9f2d116eae0cf5581cf0e1a1e79c0c3b28f7c1761 parent 27b5f76 commit a693f41
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments