Skip to content

fix(lint): ignore macOS AppleDouble HTML files#2191

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/lint-ignore-appledouble
Jul 11, 2026
Merged

fix(lint): ignore macOS AppleDouble HTML files#2191
miguel-heygen merged 1 commit into
mainfrom
fix/lint-ignore-appledouble

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Summary

  • ignore macOS ._* AppleDouble metadata files during recursive composition discovery
  • exclude AppleDouble HTML files from the multiple-root-composition check
  • add regression coverage for root and nested metadata files

Reproduction

Copying a project through a macOS external drive can create ._index.html and compositions/._scene.html. Before this change, lint parsed those resource-fork metadata files and emitted false errors such as multiple_root_compositions.

Verification

  • bun test packages/cli/src/utils/lintProject.test.ts (72 passed)
  • bunx oxlint packages/lint/src/project.ts packages/cli/src/utils/lintProject.test.ts
  • bun run --cwd packages/core typecheck
  • bun run --cwd packages/lint typecheck
  • pre-commit lint, format, typecheck, and fallow hooks passed

@miguel-heygen miguel-heygen merged commit 0e7f40d into main Jul 11, 2026
39 checks passed
@miguel-heygen miguel-heygen deleted the fix/lint-ignore-appledouble branch July 11, 2026 00:27

@vanceingalls vanceingalls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: 🟢 LGTM at c45b32ce

Small, surgical fix — filters ._ prefix on the two .html enumerators inside packages/lint/src/project.ts that were parsing AppleDouble resource-fork metadata as real compositions. Both sites patched symmetrically:

  • collectHtmlFiles at project.ts:200-204 — recursive walker, correctly catches both root-level and nested ._*.html.
  • lintMultipleRootCompositions at project.ts:442-446 — root-only enumeration, targets the specific multiple_root_compositions false-positive path.

Test at lintProject.test.ts:914-926 covers both cases (root ._index.html + nested compositions/._scene.html) and asserts BOTH multiple_root_compositions is undefined AND no result file path contains ._. Good regression lock.

The ._ prefix is macOS-specific enough (created by tar through Mac, SMB from Mac, external drives) that a legitimate composition named ._foo.html is vanishingly unlikely — the filter is safely narrow.

Non-blocking follow-up worth naming

There are ~22 other readdirSync + .html enumeration sites elsewhere in the repo — most notably packages/cli/src/utils/publishProject.ts, packages/cli/src/utils/skillsManifest.ts, packages/cli/src/commands/render.ts, packages/studio-server/src/routes/files.ts, packages/studio-server/src/helpers/projectSignature.ts, packages/studio/vite.adapter.ts / vite.config.ts. Any project copied through a Mac external drive that lands in one of those enumeration paths carries the same latent-bug shape (AppleDouble files enumerated, downstream chokes or misbehaves).

Scope-appropriate to leave for follow-up rather than fix in this PR (which is explicitly targeting lint). Worth a tracking issue naming the pattern !name.startsWith("._") guard as a general convention wherever the CLI enumerates user-content files from disk.

R1 by Via

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants