Keep iife function comments in parentheses (#18538)
This commit is contained in:
1 parent
88ffc016db
commit
e2806a30b2
9 files changed
+241
-9
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#### Keep iife function comments in parentheses (#18538 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```jsx
|
||||
// Input
|
||||
const a = (
|
||||
/**
|
||||
* @param {number} foo
|
||||
* @return {number}
|
||||
*/
|
||||
function (foo) {
|
||||
return foo + 1;
|
||||
}
|
||||
)(1);
|
||||
|
||||
// Prettier stable
|
||||
const a = /**
|
||||
* @param {number} foo
|
||||
* @return {number}
|
||||
*/
|
||||
(function (foo) {
|
||||
return foo + 1;
|
||||
})(1);
|
||||
|
||||
// Prettier main
|
||||
const a = (
|
||||
/**
|
||||
* @param {number} foo
|
||||
* @return {number}
|
||||
*/
|
||||
function (foo) {
|
||||
return foo + 1;
|
||||
}
|
||||
)(1);
|
||||
```
|
||||
Reference in new issue
Block a user