-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve formatting for AssignmentExpression with ClassExpression that…
… has long superClass (#9341) * Improve formatting for AssignmentExpression with ClassExpression that has long superClass Fix by prettier * Add changelog * Remove unnecesary concat call * Mention abount Google Closure Library in changelog
- Loading branch information
1 parent
92ea679
commit bba196a
Showing
4 changed files
with
140 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,33 @@ | ||
#### Improve formatting for `AssignmentExpression` with `ClassExpression` that has a long super class (#9341 by @sosukesuzuki) | ||
|
||
This improves the formatting for [Google Closure Library Namespace](https://developers.google.com/closure/library/docs/introduction#names). | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Input | ||
aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg2 = class extends ( | ||
aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg1 | ||
) { | ||
method () { | ||
console.log("foo"); | ||
} | ||
}; | ||
|
||
// Prettier stable | ||
aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg2 = class extends aaaaaaaa | ||
.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg1 { | ||
method() { | ||
console.log("foo"); | ||
} | ||
}; | ||
|
||
// Prettier master | ||
aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg2 = class extends ( | ||
aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg1 | ||
) { | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg2 = class extends ( | ||
aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg1 | ||
) { | ||
method () { | ||
console.log("foo"); | ||
} | ||
}; | ||
|
||
foo = class extends bar { | ||
method() { | ||
console.log("foo"); | ||
} | ||
}; | ||
|
||
aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg2 = class extends bar { | ||
method() { | ||
console.log("foo"); | ||
} | ||
}; | ||
|
||
foo = class extends aaaaaaaa.bbbbbbbb.cccccccc.dddddddd.eeeeeeee.ffffffff.gggggggg2 { | ||
method() { | ||
console.log("foo"); | ||
} | ||
}; |