Skip to content

fix: add explicit TypeScript parser to prevent XML plugin conflicts#125

Merged
Zamiell merged 2 commits into
IsaacScript:mainfrom
elliottcarlson:prettier-fix
Jul 19, 2025
Merged

fix: add explicit TypeScript parser to prevent XML plugin conflicts#125
Zamiell merged 2 commits into
IsaacScript:mainfrom
elliottcarlson:prettier-fix

Conversation

@elliottcarlson

@elliottcarlson elliottcarlson commented Jul 19, 2025

Copy link
Copy Markdown
Contributor

Problem

The @prettier/plugin-xml plugin in Prettier 3.6.0+ incorrectly identifies TypeScript files as XML, causing parsing errors during the post-install formatting step.

Error details:

  • Errors are emitted during the npx prettier --write post-install step.
  • Files affected: scripts/lint.ts, src/bundleEntry.ts, src/main.ts
  • Error: `SyntaxError: Expecting token of type --> OPEN <-- but found --> ...
  • Root cause: XML plugin attempting to parse TypeScript files

Solution

Add explicit TypeScript parser configuration in prettier.config.mjs overrides to ensure .ts files are correctly identified and parsed.

Testing

  • npx isaacscript@latest init completes successfully
  • ✅ Post-install npx prettier --write runs without errors
  • ✅ All TypeScript files format correctly
  • ✅ XML formatting remains unaffected

Impact

Fixes broken initialization flow for new projects using the latest Prettier version while maintaining compatibility with all existing plugins.

@Zamiell
Zamiell merged commit d265079 into IsaacScript:main Jul 19, 2025
23 checks passed
@Zamiell

Zamiell commented Jul 19, 2025

Copy link
Copy Markdown
Member

thank you!

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.

3 participants