Skip to content

fix(iOS): fix Prettier lint failure after SwiftPM support landed#57564

Closed
cipolleschi wants to merge 1 commit into
mainfrom
cipolleschi/fix-lint-after-swiftpm
Closed

fix(iOS): fix Prettier lint failure after SwiftPM support landed#57564
cipolleschi wants to merge 1 commit into
mainfrom
cipolleschi/fix-lint-after-swiftpm

Conversation

@cipolleschi

Copy link
Copy Markdown
Contributor

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

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:

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:

let tmp /*: string */ = '';

Semantically safe — tmp is assigned in beforeEach before any use.

Changelog:

[INTERNAL] [FIXED] - Fix Prettier lint failure in headers-xcframework test

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

The Flow comment-type annotation on the uninitialized `let tmp` was
reformatted by Prettier (moving the comment past the semicolon and
detaching the annotation), which broke the lint job's format-check step.
Giving `tmp` an initializer keeps the `/*: string */` annotation inline
and satisfies Prettier.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 15, 2026
@meta-codesync

meta-codesync Bot commented Jul 15, 2026

Copy link
Copy Markdown

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D112114604.

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in a693f41 Jul 15, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jul 15, 2026
@meta-codesync

meta-codesync Bot commented Jul 15, 2026

Copy link
Copy Markdown

@cipolleschi merged this pull request in a693f41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants