Print comments for parenthesized TS keyword types (#12070)

* Prefer node.start for TS keyword types

* Add tests

* Add changelog

* Refactor

* Use isTsKeywordType

* Fix lint problems
This commit is contained in:
Sosuke Suzuki authored and GitHub committed 2022-01-13 09:54:06 +09:00
1 parent dd3e1a49e0
commit 6ccc462409
8 files changed
+225 -2

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
#### Print comments for parenthesized TS keyword types with `babel-ts` parser (#12070 by @sosukesuzuki)
<!-- prettier-ignore -->
```ts
// Input
let foo: (
// comment
never
);
// Prettier stable
Error: Comment "comment" was not printed. Please report this error!
// Prettier main
let foo: // comment
never;
```