inconsistent printing extends for interface and class
See original GitHub issuePrettier 1.14.3 Playground link
--parser babylon
Input:
interface Foo extends
VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongClassName {}
class Foo extends
VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongClassName {}
Output:
interface Foo
extends VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongClassName {}
class Foo extends VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongClassName {}
Expected behavior:
interface Foo extends
VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongClassName {}
class Foo extends
VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongClassName {}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Inconsistent inheritance of interfaces with generic classes
Take a class hierarchy Chef extends Person extends GraphNode , where each parent class is generic in an interface T that extends the ......
Read more >Chapter 9. Interfaces
The interface inherits, from the interfaces it extends, all members of those interfaces, except for (a) fields, classes, and interfaces that it hides...
Read more >577872 – [17] The hierarchy of the type is inconsistent for valid ...
Bug 577872 - [17] The hierarchy of the type is inconsistent for valid sealed type hierarchy when non-sealed types from other packages are...
Read more >Allow extending multiple interfaces with different, but ...
you can extend multiple interfaces. for classes, you can do this ... That sounds inconsistent, or is there something I'm overlooking here?
Read more >Object Interfaces - Manual
Interfaces can be extended like classes using the extends operator. Note: The class implementing the interface must declare all methods in the interface...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Since #13358 is a duplicate of this one (dunno how I missed this while searching for an hour, sorry about that), what’s the current status? That breaking works for
implements
and combinations withimplements
andextends
, this is should behave exactly the same forextends
only.@j-f1 In
php
we useconditionalGroup
for this. Steps:interface
andextends
on same lineinterface
andextends
on difference lineMaybe we use same logic here ❓