forked from rome/tools
-
Notifications
You must be signed in to change notification settings - Fork 0
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): EcmaScript @decorators rome#4252
class member
- Loading branch information
1 parent
f6c4dc0
commit 18df5e4
Showing
18 changed files
with
1,595 additions
and
836 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
62 changes: 62 additions & 0 deletions
62
crates/rome_js_formatter/tests/specs/prettier/js/decorators/mixed.js.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,62 @@ | ||
--- | ||
source: crates/rome_formatter_test/src/snapshot_builder.rs | ||
info: js/decorators/mixed.js | ||
--- | ||
|
||
# Input | ||
|
||
```js | ||
// https://github.com/prettier/prettier/issues/6747 | ||
|
||
@foo | ||
export default class MyComponent { | ||
@task | ||
*foo() { | ||
} | ||
} | ||
``` | ||
|
||
|
||
# Prettier differences | ||
|
||
```diff | ||
--- Prettier | ||
+++ Rome | ||
@@ -2,6 +2,5 @@ | ||
|
||
@foo | ||
export default class MyComponent { | ||
- @task | ||
- *foo() {} | ||
+ @task *foo() {} | ||
} | ||
``` | ||
|
||
# Output | ||
|
||
```js | ||
// https://github.com/prettier/prettier/issues/6747 | ||
|
||
@foo | ||
export default class MyComponent { | ||
@task *foo() {} | ||
} | ||
``` | ||
|
||
# Errors | ||
``` | ||
mixed.js:3:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
× Decorators are not valid here | ||
1 │ // https://github.com/prettier/prettier/issues/6747 | ||
2 │ | ||
> 3 │ @foo | ||
│ ^^^^ | ||
4 │ export default class MyComponent { | ||
5 │ @task | ||
``` | ||
|
||
|
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
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.