This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rome_js_parser): support property init in ambient context
- Loading branch information
Showing
21 changed files
with
869 additions
and
126 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
8 changes: 8 additions & 0 deletions
8
crates/rome_js_formatter/tests/specs/ts/class/readonly_ambient_property.ts
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,8 @@ | ||
declare class A { | ||
readonly prop = "value" | ||
|
||
|
||
} | ||
class A { | ||
declare readonly prop = "value__value__value__value__value__value__value__value__value__value__value__" | ||
} |
50 changes: 50 additions & 0 deletions
50
crates/rome_js_formatter/tests/specs/ts/class/readonly_ambient_property.ts.snap
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,50 @@ | ||
--- | ||
source: crates/rome_formatter_test/src/snapshot_builder.rs | ||
assertion_line: 212 | ||
info: ts/class/readonly_ambient_property.ts | ||
--- | ||
|
||
# Input | ||
|
||
```ts | ||
declare class A { | ||
readonly prop = "value" | ||
|
||
|
||
} | ||
class A { | ||
declare readonly prop = "value__value__value__value__value__value__value__value__value__value__value__" | ||
} | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Line width: 80 | ||
Quote style: Double Quotes | ||
Quote properties: As needed | ||
Trailing comma: All | ||
Semicolons: Always | ||
----- | ||
|
||
```ts | ||
declare class A { | ||
readonly prop = "value"; | ||
} | ||
class A { | ||
declare readonly prop = "value__value__value__value__value__value__value__value__value__value__value__"; | ||
} | ||
``` | ||
|
||
# Lines exceeding max width of 80 characters | ||
``` | ||
5: declare readonly prop = "value__value__value__value__value__value__value__value__value__value__value__"; | ||
``` | ||
|
||
|
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
Oops, something went wrong.