Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting for AssignmentExpression with ClassExpression (#9741)
* Fix formatting for asignment with superClass * Add tests * Changelog * For only AssignmentExpression * Remove unnecesary ifBreak
- Loading branch information
1 parent
4f330f0
commit 3208b94
Showing
4 changed files
with
53 additions
and
10 deletions.
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,27 @@ | ||
#### Fix formatting for AssignmentExpression with ClassExpression (#9741 by @sosukesuzuki) | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Input | ||
module.exports = class A extends B { | ||
method() { | ||
console.log("foo"); | ||
} | ||
}; | ||
|
||
// Prettier stable | ||
module.exports = class A extends ( | ||
B | ||
) { | ||
method() { | ||
console.log("foo"); | ||
} | ||
}; | ||
|
||
// Prettier master | ||
module.exports = class A extends B { | ||
method() { | ||
console.log("foo"); | ||
} | ||
}; | ||
``` |
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
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