Fix exports comment formats. (#12860)

* fix exports comment formats

* add tests

* add change log

* rename function name

* merge logic

* add tests to compare comment formats in `export` and `import`
This commit is contained in:
HosokawaR authored and GitHub committed 2022-05-15 22:39:55 +09:00
1 parent 77e5589591
commit 765d78305f
5 files changed
+288 -10

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
#### Fix comment formats in (#12860 by @HosokawaR)
This change fixes comments format in `exports` to algin with the comment format in `import`
Although this change does not affect the comments format in `import`, follows change log contains examples of comments in `import` for reference.
<!-- prettier-ignore -->
```jsx
// Input
export {
foo,
bar as // comment
baz,
}
import {
foo,
bar as // comment
baz,
} from 'foo'
// Prettier stable
export {
foo,
bar as baz, // comment
};
import {
foo,
// comment
bar as baz,
} from "foo";
// Prettier main
export {
foo,
// comment
bar as baz,
};
import {
foo,
// comment
bar as baz,
} from "foo";
```