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:
1 parent
dd3e1a49e0
commit
6ccc462409
8 files changed
+225
-2
No files matched your search
@@ -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;
|
||||
```
|
||||
Reference in new issue
Block a user