fix(lint): ignore macOS AppleDouble HTML files#2191
Conversation
vanceingalls
left a comment
There was a problem hiding this comment.
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:
collectHtmlFilesatproject.ts:200-204— recursive walker, correctly catches both root-level and nested._*.html.lintMultipleRootCompositionsatproject.ts:442-446— root-only enumeration, targets the specificmultiple_root_compositionsfalse-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
Summary
._*AppleDouble metadata files during recursive composition discoveryReproduction
Copying a project through a macOS external drive can create
._index.htmlandcompositions/._scene.html. Before this change, lint parsed those resource-fork metadata files and emitted false errors such asmultiple_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.tsbun run --cwd packages/core typecheckbun run --cwd packages/lint typecheck