forked from prettier/prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flow: Print dangling comments for empty inexact object type (prettier…
…#7892) * Remove unnecessary group * Print dangling comment for inexact type * Add changelog * Fix changelog
- Loading branch information
1 parent
8a48ca2
commit 0f56b4a
Showing
4 changed files
with
221 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#### Print dangling comments for inexact object type ([#7892](https://github.com/prettier/prettier/pull/7892) by [@sosukesuzuki](https://github.com/sosukesuzuki)) | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Input | ||
type Foo = { | ||
// comment | ||
..., | ||
}; | ||
|
||
// Prettier stable | ||
Error: Comment "comment" was not printed. Please report this error! | ||
|
||
// Prettier master | ||
type Foo = { | ||
// comment | ||
..., | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
tests/flow_object_inexact/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// @flow | ||
|
||
type Foo = { | ||
// comment | ||
..., | ||
}; | ||
|
||
type Foo = { | ||
/* comment */ | ||
..., | ||
}; | ||
|
||
type Foo = { /* comment */ ... }; | ||
|
||
type Foo = { /* comment */ | ||
...}; | ||
|
||
type Foo = { | ||
// comment0 | ||
// comment1 | ||
..., | ||
}; | ||
|
||
type Foo = { | ||
/* comment0 */ | ||
/* comment1 */ | ||
..., | ||
}; | ||
|
||
type Foo = { | ||
// comment | ||
foo: string, | ||
... | ||
}; | ||
|
||
type Foo = { | ||
// comment0 | ||
// comment1 | ||
foo: string, | ||
... | ||
}; | ||
|
||
type Foo = { | ||
/* comment */ | ||
foo: string, | ||
... | ||
}; | ||
|
||
type Foo = { | ||
/* comment0 */ | ||
/* comment1 */ | ||
foo: string, | ||
... | ||
}; |