Skip to content

Avoid redundant TypeScript Prettier parser warning - #3098

Merged
nedtwigg merged 2 commits into
diffplug:mainfrom
wborn:fix/typescript-prettier-parser-warning
Sep 25, 2026
Merged

nedtwigg merged 2 commits into
diffplug:mainfrom
wborn:fix/typescript-prettier-parser-warning

Conversation

@wborn

@wborn wborn commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

The TypeScript Prettier configuration always sets the parser to typescript.

When subsequent configuration methods recreate the formatter step, the parser is already set to typescript, causing Spotless to emit a misleading warning:

overriding parser option to 'typescript'. Was set to 'typescript'

Avoid emitting the warning when the parser is already typescript, while preserving the warning when a different parser is actually overridden.

Tests cover both cases:

  • no warning when the parser is already typescript
  • warning when overriding another parser such as babel

Do not warn when the Prettier parser is already set to `typescript`.
Continue warning when a different parser is overridden.

Add tests for both cases.
@nedtwigg
nedtwigg merged commit c30a9f1 into diffplug:main Sep 25, 2026
18 checks passed
@wborn
wborn deleted the fix/typescript-prettier-parser-warning branch September 26, 2026 07:41
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