Skip to content

fix(lint): preserve quoted foreign import paths - #1422

Merged
Lorenzobattistela merged 2 commits into
bendlang:mainfrom
vicmcorrea:fix/lint-foreign-import-literals
Oct 8, 2026
Merged

Lorenzobattistela merged 2 commits into
bendlang:mainfrom
vicmcorrea:fix/lint-foreign-import-literals

Conversation

@vicmcorrea

Copy link
Copy Markdown
Contributor

bend-lint refuses whole-file formatting when a quoted foreign import filename contains # or whitespace-bounded as. The import formatter treats those bytes as a comment or module alias, and the safety guard correctly rejects the changed path.

Use existing comment-token offsets to locate trailing comments and preserve literal paths during alias normalization. Add regressions for hashes, spaces, raw backslashes, trailing comments and LF/CRLF, plus a module path and alias named as. The tests stay in bend-lint's own suite, following the maintainer guidance in #1389.

Validation:

  • All 115 bend-lint tests pass; the three foreign-path regressions fail on the original formatter.
  • Actual --fix runs preserve both affected filenames under LF/CRLF, produce a clean second lint run, and preserve program output before/after formatting and in emitted JavaScript.
  • Repository gate: 54/54; git diff --check passes.
  • Two independent reviews found no actionable issues.

Typecheck still reports the same two pre-existing TS2339 errors as clean main, in bend2/bend.ts at lines 2040 and 3771. There are no new diagnostics.

@Lorenzobattistela Lorenzobattistela self-assigned this Oct 8, 2026
@Lorenzobattistela
Lorenzobattistela merged commit 000de96 into bendlang:main Oct 8, 2026
1 check passed
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