- {
- // Some very v ery very very merry (xmas) very very long line to break line width limit
- }
-
;
-
-
- {/*
Some very v ery very very long line to break line width limit
*/}
-
;
-
-
- {/**
- * JSDoc-y comment in JSX. I wonder what will happen to it?
- */}
-
;
-
-
- {/**
- * Another JSDoc comment in JSX.
- */}
-
;
-
-
{}}
->
;
-
-
- {foo}
-
;
-
-
- {foo}
-
;
-
-
- {foo}
-
;
-
-
- {children}
-
;
-
-
- {}
-
-;
-```
-
-# Lines exceeding max width of 80 characters
-```
- 53: // Some very v ery very very merry (xmas) very very long line to break line width limit
- 58: {/*
Some very v ery very very long line to break line width limit
*/}
-```
-
-
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments/multi-comments-on-same-line.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments/multi-comments-on-same-line.js.prettier-snap
index 02facde8a46..98533fd3583 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/comments/multi-comments-on-same-line.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments/multi-comments-on-same-line.js.prettier-snap
@@ -16,8 +16,7 @@ a;
b;
a; /*
-1*/ /*2*/
-/*3
+1*/ /*2*/ /*3
*/
b;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments/multi-comments-on-same-line.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments/multi-comments-on-same-line.js.snap
index b06408dc1b8..0aa7a06200d 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/comments/multi-comments-on-same-line.js.snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments/multi-comments-on-same-line.js.snap
@@ -1,6 +1,5 @@
---
source: crates/rome_formatter_test/src/snapshot_builder.rs
-assertion_line: 212
info: js/comments/multi-comments-on-same-line.js
---
@@ -105,13 +104,7 @@ a;/*
```diff
--- Prettier
+++ Rome
-@@ -16,15 +16,14 @@
- b;
-
- a; /*
--1*/ /*2*/
--/*3
-+1*/ /*2*/ /*3
+@@ -20,10 +20,10 @@
*/
b;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments/trailing-jsdocs.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments/trailing-jsdocs.js.prettier-snap
index c2a54b85adc..c19b4dd93c8 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/comments/trailing-jsdocs.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments/trailing-jsdocs.js.prettier-snap
@@ -5,11 +5,9 @@ const CONNECTION_STATUS = (exports.CONNECTION_STATUS = {
NOT_CONNECTED: Object.freeze({ kind: "NOT_CONNECTED" }),
});
-/* A comment */
-/**
+/* A comment */ /**
* A type that can be written to a buffer.
- */
-/**
+ */ /**
* Describes the connection status of a ReactiveSocket/DuplexConnection.
* - NOT_CONNECTED: no connection established or pending.
* - CONNECTING: when `connect()` has been called but a connection is not yet
@@ -17,11 +15,9 @@ const CONNECTION_STATUS = (exports.CONNECTION_STATUS = {
* - CONNECTED: when a connection is established.
* - CLOSED: when the connection has been explicitly closed via `close()`.
* - ERROR: when the connection has been closed for any other reason.
- */
-/**
+ */ /**
* A contract providing different interaction models per the [ReactiveSocket protocol]
* (https://github.com/ReactiveSocket/reactivesocket/blob/master/Protocol.md).
- */
-/**
+ */ /**
* A single unit of data exchanged between the peers of a `ReactiveSocket`.
*/
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments/trailing-jsdocs.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments/trailing-jsdocs.js.snap
new file mode 100644
index 00000000000..d3414a95202
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments/trailing-jsdocs.js.snap
@@ -0,0 +1,107 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/comments/trailing-jsdocs.js
+---
+
+# Input
+
+```js
+const CONNECTION_STATUS = exports.CONNECTION_STATUS = {
+ CLOSED: Object.freeze({ kind: 'CLOSED' }),
+ CONNECTED: Object.freeze({ kind: 'CONNECTED' }),
+ CONNECTING: Object.freeze({ kind: 'CONNECTING' }),
+ NOT_CONNECTED: Object.freeze({ kind: 'NOT_CONNECTED' }) };
+
+/* A comment */ /**
+* A type that can be written to a buffer.
+*/ /**
+* Describes the connection status of a ReactiveSocket/DuplexConnection.
+* - NOT_CONNECTED: no connection established or pending.
+* - CONNECTING: when `connect()` has been called but a connection is not yet
+* established.
+* - CONNECTED: when a connection is established.
+* - CLOSED: when the connection has been explicitly closed via `close()`.
+* - ERROR: when the connection has been closed for any other reason.
+*/ /**
+* A contract providing different interaction models per the [ReactiveSocket protocol]
+* (https://github.com/ReactiveSocket/reactivesocket/blob/master/Protocol.md).
+*/ /**
+* A single unit of data exchanged between the peers of a `ReactiveSocket`.
+*/
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -5,9 +5,11 @@
+ NOT_CONNECTED: Object.freeze({ kind: "NOT_CONNECTED" }),
+ });
+
+-/* A comment */ /**
++/* A comment */
++/**
+ * A type that can be written to a buffer.
+- */ /**
++ */
++/**
+ * Describes the connection status of a ReactiveSocket/DuplexConnection.
+ * - NOT_CONNECTED: no connection established or pending.
+ * - CONNECTING: when `connect()` has been called but a connection is not yet
+@@ -15,9 +17,11 @@
+ * - CONNECTED: when a connection is established.
+ * - CLOSED: when the connection has been explicitly closed via `close()`.
+ * - ERROR: when the connection has been closed for any other reason.
+- */ /**
++ */
++/**
+ * A contract providing different interaction models per the [ReactiveSocket protocol]
+ * (https://github.com/ReactiveSocket/reactivesocket/blob/master/Protocol.md).
+- */ /**
++ */
++/**
+ * A single unit of data exchanged between the peers of a `ReactiveSocket`.
+ */
+```
+
+# Output
+
+```js
+const CONNECTION_STATUS = (exports.CONNECTION_STATUS = {
+ CLOSED: Object.freeze({ kind: "CLOSED" }),
+ CONNECTED: Object.freeze({ kind: "CONNECTED" }),
+ CONNECTING: Object.freeze({ kind: "CONNECTING" }),
+ NOT_CONNECTED: Object.freeze({ kind: "NOT_CONNECTED" }),
+});
+
+/* A comment */
+/**
+ * A type that can be written to a buffer.
+ */
+/**
+ * Describes the connection status of a ReactiveSocket/DuplexConnection.
+ * - NOT_CONNECTED: no connection established or pending.
+ * - CONNECTING: when `connect()` has been called but a connection is not yet
+ * established.
+ * - CONNECTED: when a connection is established.
+ * - CLOSED: when the connection has been explicitly closed via `close()`.
+ * - ERROR: when the connection has been closed for any other reason.
+ */
+/**
+ * A contract providing different interaction models per the [ReactiveSocket protocol]
+ * (https://github.com/ReactiveSocket/reactivesocket/blob/master/Protocol.md).
+ */
+/**
+ * A single unit of data exchanged between the peers of a `ReactiveSocket`.
+ */
+```
+
+# Lines exceeding max width of 80 characters
+```
+ 22: * A contract providing different interaction models per the [ReactiveSocket protocol]
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js b/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js
new file mode 100644
index 00000000000..cd560095f03
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js
@@ -0,0 +1,19 @@
+let object = // Comment
+{
+ key: 'value'
+}
+
+let record = // Comment
+#{
+ key: 'value'
+}
+
+let array = // Comment
+[
+ 'value'
+]
+
+let tuple = // Comment
+#[
+ 'value'
+]
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js.prettier-snap
new file mode 100644
index 00000000000..8862538ad32
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js.prettier-snap
@@ -0,0 +1,19 @@
+let object =
+ // Comment
+ {
+ key: "value",
+ };
+
+let record =
+ // Comment
+ #{
+ key: "value",
+ };
+
+let array =
+ // Comment
+ ["value"];
+
+let tuple =
+ // Comment
+ #["value"];
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js.snap
new file mode 100644
index 00000000000..59f148392ae
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/comments/tuple-and-record.js.snap
@@ -0,0 +1,207 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/comments/tuple-and-record.js
+---
+
+# Input
+
+```js
+let object = // Comment
+{
+ key: 'value'
+}
+
+let record = // Comment
+#{
+ key: 'value'
+}
+
+let array = // Comment
+[
+ 'value'
+]
+
+let tuple = // Comment
+#[
+ 'value'
+]
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -4,16 +4,16 @@
+ key: "value",
+ };
+
+-let record =
+- // Comment
+- #{
+- key: "value",
+- };
++let record = // Comment
++ #;
++{
++ key: "value";
++}
+
+ let array =
+ // Comment
+ ["value"];
+
+-let tuple =
+- // Comment
+- #["value"];
++let tuple = // Comment
++ #;
++["value"];
+```
+
+# Output
+
+```js
+let object =
+ // Comment
+ {
+ key: "value",
+ };
+
+let record = // Comment
+ #;
+{
+ key: "value";
+}
+
+let array =
+ // Comment
+ ["value"];
+
+let tuple = // Comment
+ #;
+["value"];
+```
+
+# Errors
+```
+tuple-and-record.js:7:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected an identifier but instead found '{'
+
+ 6 │ let record = // Comment
+ > 7 │ #{
+ │ ^
+ 8 │ key: 'value'
+ 9 │ }
+
+ i Expected an identifier here
+
+ 6 │ let record = // Comment
+ > 7 │ #{
+ │ ^
+ 8 │ key: 'value'
+ 9 │ }
+
+tuple-and-record.js:7:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Private names are only allowed on the left side of a 'in' expression
+
+ 6 │ let record = // Comment
+ > 7 │ #{
+ │ ^
+ 8 │ key: 'value'
+ 9 │ }
+
+tuple-and-record.js:7:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 6 │ let record = // Comment
+ > 7 │ #{
+ │ ^
+ 8 │ key: 'value'
+ 9 │ }
+
+ i An explicit or implicit semicolon is expected here...
+
+ 6 │ let record = // Comment
+ > 7 │ #{
+ │ ^
+ 8 │ key: 'value'
+ 9 │ }
+
+ i ...Which is required to end this statement
+
+ 4 │ }
+ 5 │
+ > 6 │ let record = // Comment
+ │ ^^^^^^^^^^^^^^^^^^^^^^^
+ > 7 │ #{
+ │ ^
+ 8 │ key: 'value'
+ 9 │ }
+
+tuple-and-record.js:17:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected an identifier but instead found '['
+
+ 16 │ let tuple = // Comment
+ > 17 │ #[
+ │ ^
+ 18 │ 'value'
+ 19 │ ]
+
+ i Expected an identifier here
+
+ 16 │ let tuple = // Comment
+ > 17 │ #[
+ │ ^
+ 18 │ 'value'
+ 19 │ ]
+
+tuple-and-record.js:17:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Private names are only allowed on the left side of a 'in' expression
+
+ 16 │ let tuple = // Comment
+ > 17 │ #[
+ │ ^
+ 18 │ 'value'
+ 19 │ ]
+
+tuple-and-record.js:17:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 16 │ let tuple = // Comment
+ > 17 │ #[
+ │ ^
+ 18 │ 'value'
+ 19 │ ]
+
+ i An explicit or implicit semicolon is expected here...
+
+ 16 │ let tuple = // Comment
+ > 17 │ #[
+ │ ^
+ 18 │ 'value'
+ 19 │ ]
+
+ i ...Which is required to end this statement
+
+ 14 │ ]
+ 15 │
+ > 16 │ let tuple = // Comment
+ │ ^^^^^^^^^^^^^^^^^^^^^^
+ > 17 │ #[
+ │ ^
+ 18 │ 'value'
+ 19 │ ]
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/cursor/cursor-emoji.js b/crates/rome_js_formatter/tests/specs/prettier/js/cursor/cursor-emoji.js
new file mode 100644
index 00000000000..c1a8863d515
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/cursor/cursor-emoji.js
@@ -0,0 +1 @@
+"😀😀😀😀<|>"
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/cursor/cursor-emoji.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/cursor/cursor-emoji.js.prettier-snap
new file mode 100644
index 00000000000..c9442b05a0b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/cursor/cursor-emoji.js.prettier-snap
@@ -0,0 +1 @@
+"😀😀😀😀<|>";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/arguments.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/arguments.js.prettier-snap
index 0c2170803f1..8ed29ec3615 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/arguments.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/arguments.js.prettier-snap
@@ -1,12 +1,8 @@
console.log(
- (
- @deco
- class Foo {}
- ),
+ @deco
+ class Foo {},
);
console.log(
- (
- @deco
- class {}
- ),
+ @deco
+ class {},
);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/arguments.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/arguments.js.snap
new file mode 100644
index 00000000000..8c34cdac708
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/arguments.js.snap
@@ -0,0 +1,56 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/decorators/class-expression/arguments.js
+---
+
+# Input
+
+```js
+console.log(@deco class Foo {})
+console.log(@deco class {})
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,8 +1,12 @@
+ console.log(
+- @deco
+- class Foo {},
++ (
++ @deco
++ class Foo {}
++ ),
+ );
+ console.log(
+- @deco
+- class {},
++ (
++ @deco
++ class {}
++ ),
+ );
+```
+
+# Output
+
+```js
+console.log(
+ (
+ @deco
+ class Foo {}
+ ),
+);
+console.log(
+ (
+ @deco
+ class {}
+ ),
+);
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/class-expression.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/class-expression.js.prettier-snap
index 5711c5f3095..2a85b8156d4 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/class-expression.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/class-expression.js.prettier-snap
@@ -1,13 +1,9 @@
const a1 =
- (
- @deco
- class Foo {}
- );
+ @deco
+ class Foo {};
const a2 =
- (
- @deco
- class {}
- );
+ @deco
+ class {};
(
@deco
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/class-expression.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/class-expression.js.snap
new file mode 100644
index 00000000000..0cd99f3a95b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/class-expression/class-expression.js.snap
@@ -0,0 +1,92 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/decorators/class-expression/class-expression.js
+---
+
+# Input
+
+```js
+const a1 = (@deco class Foo {});
+const a2 = (@deco class {});
+
+(@deco class Foo {});
+(@deco class {});
+
+const b1 = []
+;(@deco class Foo {})
+
+const b2 = []
+;(@deco class {})
+
+// This is not a `ClassExpression` but `ClassDeclaration`
+@deco class Foo {}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,9 +1,13 @@
+ const a1 =
+- @deco
+- class Foo {};
++ (
++ @deco
++ class Foo {}
++ );
+ const a2 =
+- @deco
+- class {};
++ (
++ @deco
++ class {}
++ );
+
+ (
+ @deco
+```
+
+# Output
+
+```js
+const a1 =
+ (
+ @deco
+ class Foo {}
+ );
+const a2 =
+ (
+ @deco
+ class {}
+ );
+
+(
+ @deco
+ class Foo {}
+);
+(
+ @deco
+ class {}
+);
+
+const b1 = [];
+(
+ @deco
+ class Foo {}
+);
+
+const b2 = [];
+(
+ @deco
+ class {}
+);
+
+// This is not a `ClassExpression` but `ClassDeclaration`
+@deco
+class Foo {}
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/classes.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/classes.js.prettier-snap
index 30987e5db7b..98d2ee13ef8 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/classes.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/classes.js.prettier-snap
@@ -8,17 +8,13 @@ export class Bar {}
export default class Baz {}
const foo =
- (
- @deco
- class {
- //
- }
- );
+ @deco
+ class {
+ //
+ };
const bar =
- (
- @deco
- class {
- //
- }
- );
+ @deco
+ class {
+ //
+ };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/classes.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/classes.js.snap
new file mode 100644
index 00000000000..0daeb51e365
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/classes.js.snap
@@ -0,0 +1,90 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/decorators/classes.js
+---
+
+# Input
+
+```js
+@deco class Foo {}
+
+@deco export class Bar {}
+
+@deco export default class Baz {}
+
+const foo = @deco class {
+ //
+};
+
+const bar =
+ @deco
+ class {
+ //
+ };
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -8,13 +8,17 @@
+ export default class Baz {}
+
+ const foo =
+- @deco
+- class {
+- //
+- };
++ (
++ @deco
++ class {
++ //
++ }
++ );
+
+ const bar =
+- @deco
+- class {
+- //
+- };
++ (
++ @deco
++ class {
++ //
++ }
++ );
+```
+
+# Output
+
+```js
+@deco
+class Foo {}
+
+@deco
+export class Bar {}
+
+@deco
+export default class Baz {}
+
+const foo =
+ (
+ @deco
+ class {
+ //
+ }
+ );
+
+const bar =
+ (
+ @deco
+ class {
+ //
+ }
+ );
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/comments.js b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/comments.js
index 8aa68576c59..8a647cdcf91 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/comments.js
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/comments.js
@@ -29,3 +29,8 @@ export class AppModule {}
@Bar()
// C
export class Bar{}
+
+class Something {
+ @Annotateme()
+ property;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/comments.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/comments.js.prettier-snap
index 614664decd1..11471303c38 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/comments.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/comments.js.prettier-snap
@@ -26,3 +26,8 @@ export class AppModule {}
@Bar()
// C
export class Bar {}
+
+class Something {
+ @Annotateme()
+ property;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/member-expression.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/member-expression.js.prettier-snap
index 4cd2681adc3..0614bd8faf1 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/member-expression.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/member-expression.js.prettier-snap
@@ -39,16 +39,12 @@
@(decorators["first"])
method() {}
},
- (
- @(decorators[first])
- class {
- method() {}
- }
- ),
- (
- @(decorators[0])
- class {
- method() {}
- }
- ),
+ @(decorators[first])
+ class {
+ method() {}
+ },
+ @(decorators[0])
+ class {
+ method() {}
+ },
];
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/member-expression.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/member-expression.js.snap
index 3d86037e90e..f1dd29ff978 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/member-expression.js.snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/member-expression.js.snap
@@ -83,6 +83,31 @@ info: js/decorators/member-expression.js
method() {}
},
class {
+@@ -39,12 +39,16 @@
+ @(decorators["first"])
+ method() {}
+ },
+- @(decorators[first])
+- class {
+- method() {}
+- },
+- @(decorators[0])
+- class {
+- method() {}
+- },
++ (
++ @(decorators[first])
++ class {
++ method() {}
++ }
++ ),
++ (
++ @(decorators[0])
++ class {
++ method() {}
++ }
++ ),
+ ];
```
# Output
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js
index 8a497af8062..2974474a586 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js
@@ -1,8 +1,8 @@
import {observable} from "mobx";
@observer class OrderLine {
- @observable price:number = 0;
- @observable amount:number = 1;
+ @observable price = 0;
+ @observable amount = 1;
constructor(price) {
this.price = price;
@@ -25,12 +25,12 @@ import {observable} from "mobx";
setPrice(price) {
this.price = price;
}
-
+
@computed @computed @computed @computed @computed @computed @computed get total() {
return this.price * this.amount;
}
- @action handleDecrease = (event: React.ChangeEvent) => this.count--;
-
- @action handleSomething = (event: React.ChangeEvent) => doSomething();
+ @action handleDecrease = (event) => this.count--;
+
+ @action handleSomething = (event) => doSomething();
}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js.prettier-snap
index a1daee3b10a..ccfd4bf71f9 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js.prettier-snap
@@ -2,8 +2,8 @@ import { observable } from "mobx";
@observer
class OrderLine {
- @observable price: number = 0;
- @observable amount: number = 1;
+ @observable price = 0;
+ @observable amount = 1;
constructor(price) {
this.price = price;
@@ -38,9 +38,7 @@ class OrderLine {
return this.price * this.amount;
}
- @action handleDecrease = (event: React.ChangeEvent) =>
- this.count--;
+ @action handleDecrease = (event) => this.count--;
- @action handleSomething = (event: React.ChangeEvent) =>
- doSomething();
+ @action handleSomething = (event) => doSomething();
}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js.snap
deleted file mode 100644
index 54489131594..00000000000
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/mobx.js.snap
+++ /dev/null
@@ -1,190 +0,0 @@
----
-source: crates/rome_formatter_test/src/snapshot_builder.rs
-info: js/decorators/mobx.js
----
-
-# Input
-
-```js
-import {observable} from "mobx";
-
-@observer class OrderLine {
- @observable price:number = 0;
- @observable amount:number = 1;
-
- constructor(price) {
- this.price = price;
- }
-
- @computed get total() {
- return this.price * this.amount;
- }
-
- @action.bound setPrice(price) {
- this.price = price;
- }
-
- @computed
- get total() {
- return this.price * this.amount;
- }
-
- @action.bound
- setPrice(price) {
- this.price = price;
- }
-
- @computed @computed @computed @computed @computed @computed @computed get total() {
- return this.price * this.amount;
- }
-
- @action handleDecrease = (event: React.ChangeEvent) => this.count--;
-
- @action handleSomething = (event: React.ChangeEvent) => doSomething();
-}
-
-```
-
-
-# Prettier differences
-
-```diff
---- Prettier
-+++ Rome
-@@ -2,8 +2,8 @@
-
- @observer
- class OrderLine {
-- @observable price: number = 0;
-- @observable amount: number = 1;
-+ @observable price:number = 0;
-+ @observable amount:number = 1;
-
- constructor(price) {
- this.price = price;
-@@ -38,9 +38,7 @@
- return this.price * this.amount;
- }
-
-- @action handleDecrease = (event: React.ChangeEvent) =>
-- this.count--;
-+ @action handleDecrease = (event: React.ChangeEvent) => this.count--;
-
-- @action handleSomething = (event: React.ChangeEvent) =>
-- doSomething();
-+ @action handleSomething = (event: React.ChangeEvent) => doSomething();
- }
-```
-
-# Output
-
-```js
-import { observable } from "mobx";
-
-@observer
-class OrderLine {
- @observable price:number = 0;
- @observable amount:number = 1;
-
- constructor(price) {
- this.price = price;
- }
-
- @computed get total() {
- return this.price * this.amount;
- }
-
- @action.bound setPrice(price) {
- this.price = price;
- }
-
- @computed
- get total() {
- return this.price * this.amount;
- }
-
- @action.bound
- setPrice(price) {
- this.price = price;
- }
-
- @computed
- @computed
- @computed
- @computed
- @computed
- @computed
- @computed
- get total() {
- return this.price * this.amount;
- }
-
- @action handleDecrease = (event: React.ChangeEvent) => this.count--;
-
- @action handleSomething = (event: React.ChangeEvent) => doSomething();
-}
-```
-
-# Errors
-```
-mobx.js:4:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × return types can only be used in TypeScript files
-
- 3 │ @observer class OrderLine {
- > 4 │ @observable price:number = 0;
- │ ^^^^^^^
- 5 │ @observable amount:number = 1;
- 6 │
-
- i remove this type annotation
-
-mobx.js:5:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × return types can only be used in TypeScript files
-
- 3 │ @observer class OrderLine {
- 4 │ @observable price:number = 0;
- > 5 │ @observable amount:number = 1;
- │ ^^^^^^^
- 6 │
- 7 │ constructor(price) {
-
- i remove this type annotation
-
-mobx.js:33:34 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.
-
- 31 │ }
- 32 │
- > 33 │ @action handleDecrease = (event: React.ChangeEvent) => this.count--;
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- 34 │
- 35 │ @action handleSomething = (event: React.ChangeEvent) => doSomething();
-
- i TypeScript only syntax
-
-mobx.js:35:35 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.
-
- 33 │ @action handleDecrease = (event: React.ChangeEvent) => this.count--;
- 34 │
- > 35 │ @action handleSomething = (event: React.ChangeEvent) => doSomething();
- │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- 36 │ }
- 37 │
-
- i TypeScript only syntax
-
-
-```
-
-# Lines exceeding max width of 80 characters
-```
- 41: @action handleDecrease = (event: React.ChangeEvent) => this.count--;
- 43: @action handleSomething = (event: React.ChangeEvent) => doSomething();
-```
-
-
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js
index f35b7018f59..0a83753c91c 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js
@@ -1,15 +1,16 @@
-const dog = {
+const dog = class {
@readonly
@nonenumerable
@doubledValue
- legs: 4,
+ legs = 4;
@readonly
@nonenumerable
@doubledValue
- eyes: 2
+ eyes() {return 2}
};
-const foo = {
- @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName: "A very long string as value"
+const foo = class {
+ @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName = "A very long string as value"
+ @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName() { "A very long string as value"}
};
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.prettier-snap
index 725b9490942..8bcc0e87b9b 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.prettier-snap
@@ -1,18 +1,21 @@
-const dog = {
+const dog = class {
@readonly
@nonenumerable
@doubledValue
- legs: 4,
+ legs = 4;
@readonly
@nonenumerable
@doubledValue
- eyes: 2,
+ eyes() {
+ return 2;
+ }
};
-const foo = {
- @multipleDecorators
- @inline
- @theyWontAllFitInOneline
- aVeryLongPropName: "A very long string as value",
+const foo = class {
+ @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName =
+ "A very long string as value";
+ @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName() {
+ "A very long string as value";
+ }
};
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.snap
deleted file mode 100644
index a04cfa7e43d..00000000000
--- a/crates/rome_js_formatter/tests/specs/prettier/js/decorators/multiple.js.snap
+++ /dev/null
@@ -1,194 +0,0 @@
----
-source: crates/rome_formatter_test/src/snapshot_builder.rs
-info: js/decorators/multiple.js
----
-
-# Input
-
-```js
-const dog = {
- @readonly
- @nonenumerable
- @doubledValue
- legs: 4,
-
- @readonly
- @nonenumerable
- @doubledValue
- eyes: 2
-};
-
-const foo = {
- @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName: "A very long string as value"
-};
-
-```
-
-
-# Prettier differences
-
-```diff
---- Prettier
-+++ Rome
-@@ -1,18 +1,17 @@
- const dog = {
-- @readonly
-+@readonly
- @nonenumerable
- @doubledValue
-- legs: 4,
-+legs: 4,
-
- @readonly
- @nonenumerable
- @doubledValue
-- eyes: 2,
--};
-+ eyes
-+: 2
-+}
-
- const foo = {
-- @multipleDecorators
-- @inline
-- @theyWontAllFitInOneline
-- aVeryLongPropName: "A very long string as value",
--};
-+@multipleDecorators @inline @theyWontAllFitInOneline
-+aVeryLongPropName: "A very long string as value";
-+}
-```
-
-# Output
-
-```js
-const dog = {
-@readonly
- @nonenumerable
- @doubledValue
-legs: 4,
-
- @readonly
- @nonenumerable
- @doubledValue
- eyes
-: 2
-}
-
-const foo = {
-@multipleDecorators @inline @theyWontAllFitInOneline
-aVeryLongPropName: "A very long string as value";
-}
-```
-
-# Errors
-```
-multiple.js:2:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × expected a property, a shorthand property, a getter, a setter, or a method but instead found '@'
-
- 1 │ const dog = {
- > 2 │ @readonly
- │ ^
- 3 │ @nonenumerable
- 4 │ @doubledValue
-
- i Expected a property, a shorthand property, a getter, a setter, or a method here
-
- 1 │ const dog = {
- > 2 │ @readonly
- │ ^
- 3 │ @nonenumerable
- 4 │ @doubledValue
-
-multiple.js:7:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × Decorators are not valid here.
-
- 5 │ legs: 4,
- 6 │
- > 7 │ @readonly
- │ ^^^^^^^^^
- > 8 │ @nonenumerable
- > 9 │ @doubledValue
- │ ^^^^^^^^^^^^^
- 10 │ eyes: 2
- 11 │ };
-
- i Decorators are only valid on class declarations, class expressions, and class methods.
-
-multiple.js:10:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × Expected a semicolon or an implicit semicolon after a statement, but found none
-
- 8 │ @nonenumerable
- 9 │ @doubledValue
- > 10 │ eyes: 2
- │ ^
- 11 │ };
- 12 │
-
- i An explicit or implicit semicolon is expected here...
-
- 8 │ @nonenumerable
- 9 │ @doubledValue
- > 10 │ eyes: 2
- │ ^
- 11 │ };
- 12 │
-
- i ...Which is required to end this statement
-
- 3 │ @nonenumerable
- 4 │ @doubledValue
- > 5 │ legs: 4,
- │ ^^
- > 6 │
- > 7 │ @readonly
- > 8 │ @nonenumerable
- > 9 │ @doubledValue
- > 10 │ eyes: 2
- │ ^^^^^
- 11 │ };
- 12 │
-
-multiple.js:14:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × expected a property, a shorthand property, a getter, a setter, or a method but instead found '@'
-
- 13 │ const foo = {
- > 14 │ @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName: "A very long string as value"
- │ ^
- 15 │ };
- 16 │
-
- i Expected a property, a shorthand property, a getter, a setter, or a method here
-
- 13 │ const foo = {
- > 14 │ @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName: "A very long string as value"
- │ ^
- 15 │ };
- 16 │
-
-multiple.js:15:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
- × expected a statement but instead found '}'
-
- 13 │ const foo = {
- 14 │ @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName: "A very long string as value"
- > 15 │ };
- │ ^
- 16 │
-
- i Expected a statement here
-
- 13 │ const foo = {
- 14 │ @multipleDecorators @inline @theyWontAllFitInOneline aVeryLongPropName: "A very long string as value"
- > 15 │ };
- │ ^
- 16 │
-
-
-```
-
-
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js b/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js
index e2b49710802..8e368c09d9c 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js
@@ -52,3 +52,17 @@ function foo() {
obj[key];
}
};
+
+() => ( ) => do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+};
+
+a =>b=> c => do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+};
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js.prettier-snap
index 01179b75859..43f6bcb0bd2 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js.prettier-snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js.prettier-snap
@@ -55,3 +55,17 @@ function foo() {
obj[key];
}
};
+
+() => () => do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+};
+
+(a) => (b) => (c) => do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+};
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js.snap
index 57e5fa7ada7..39d2d4ecac6 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js.snap
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/do/do.js.snap
@@ -1,6 +1,5 @@
---
source: crates/rome_formatter_test/src/snapshot_builder.rs
-assertion_line: 212
info: js/do/do.js
---
@@ -62,6 +61,20 @@ function foo() {
}
};
+() => ( ) => do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+};
+
+a =>b=> c => do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+};
+
```
@@ -70,7 +83,7 @@ function foo() {
```diff
--- Prettier
+++ Rome
-@@ -1,55 +1,61 @@
+@@ -1,69 +1,77 @@
const envSpecific = {
- domain: do {
- if (env === "production") "https://abc.mno.com/";
@@ -160,6 +173,24 @@ function foo() {
-() => do {
+() =>
++do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+ };
+
+-() => () => do {
++() => ( ) =>
++do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+ };
+
+-(a) => (b) => (c) => do {
++a =>b=> c =>
+do {
var obj = { foo: "bar", bar: "foo" };
for (var key in obj) {
@@ -232,6 +263,22 @@ do {
obj[key];
}
};
+
+() => ( ) =>
+do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+};
+
+a =>b=> c =>
+do {
+ var obj = { foo: "bar", bar: "foo" };
+ for (var key in obj) {
+ obj[key];
+ }
+};
```
# Errors
@@ -645,6 +692,72 @@ do.js:54:2 parse ━━━━━━━━━━━━━━━━━━━━━
> 54 │ };
│ ^
55 │
+ 56 │ () => ( ) => do {
+
+ i Remove ;
+
+do.js:56:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected a function body, or an expression but instead found 'do'
+
+ 54 │ };
+ 55 │
+ > 56 │ () => ( ) => do {
+ │ ^^
+ 57 │ var obj = { foo: "bar", bar: "foo" };
+ 58 │ for (var key in obj) {
+
+ i Expected a function body, or an expression here
+
+ 54 │ };
+ 55 │
+ > 56 │ () => ( ) => do {
+ │ ^^
+ 57 │ var obj = { foo: "bar", bar: "foo" };
+ 58 │ for (var key in obj) {
+
+do.js:61:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `while` but instead found `;`
+
+ 59 │ obj[key];
+ 60 │ }
+ > 61 │ };
+ │ ^
+ 62 │
+ 63 │ a =>b=> c => do {
+
+ i Remove ;
+
+do.js:63:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected a function body, or an expression but instead found 'do'
+
+ 61 │ };
+ 62 │
+ > 63 │ a =>b=> c => do {
+ │ ^^
+ 64 │ var obj = { foo: "bar", bar: "foo" };
+ 65 │ for (var key in obj) {
+
+ i Expected a function body, or an expression here
+
+ 61 │ };
+ 62 │
+ > 63 │ a =>b=> c => do {
+ │ ^^
+ 64 │ var obj = { foo: "bar", bar: "foo" };
+ 65 │ for (var key in obj) {
+
+do.js:68:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `while` but instead found `;`
+
+ 66 │ obj[key];
+ 67 │ }
+ > 68 │ };
+ │ ^
+ 69 │
i Remove ;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js
new file mode 100644
index 00000000000..97230845f53
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js
@@ -0,0 +1 @@
+/*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js.prettier-snap
new file mode 100644
index 00000000000..1998906c61d
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js.prettier-snap
@@ -0,0 +1 @@
+/*1*/ for await (/* 2 */ /*3*/ /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/ /*9*/);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js.snap
new file mode 100644
index 00000000000..8c921795939
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/for-await-using-of-comments.js.snap
@@ -0,0 +1,121 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/for-await-using-of-comments.js
+---
+
+# Input
+
+```js
+/*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1 +1,2 @@
+-/*1*/ for await (/* 2 */ /*3*/ /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/ /*9*/);
++/*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/
++) /*9*/
+```
+
+# Output
+
+```js
+/*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/
+) /*9*/
+```
+
+# Errors
+```
+for-await-using-of-comments.js:1:51 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `fo`
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^^
+ 2 │
+
+ i Remove fo
+
+for-await-using-of-comments.js:1:60 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `of`
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^^
+ 2 │
+
+ i Remove of
+
+for-await-using-of-comments.js:1:69 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `)` but instead found `of`
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^^
+ 2 │
+
+ i Remove of
+
+for-await-using-of-comments.js:1:77 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^
+ 2 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^
+ 2 │
+
+ i ...Which is required to end this statement
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^^^^^^^^^
+ 2 │
+
+for-await-using-of-comments.js:1:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × await can only be used in conjunction with `for...of` statements
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^^^^^
+ 2 │
+
+ i Remove the await here
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^^^^^
+ 2 │
+
+ i or convert this to a `for...of` statement
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ 2 │
+
+for-await-using-of-comments.js:1:77 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected a statement but instead found ')'
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^
+ 2 │
+
+ i Expected a statement here
+
+ > 1 │ /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
+ │ ^
+ 2 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js
new file mode 100644
index 00000000000..d04dedd0e6b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js
@@ -0,0 +1,7 @@
+{
+ using f, f = foo();
+}
+{
+ using g = foo();
+ using g = foo();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js.prettier-snap
new file mode 100644
index 00000000000..6bb2b76a508
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js.prettier-snap
@@ -0,0 +1,8 @@
+{
+ using f,
+ f = foo();
+}
+{
+ using g = foo();
+ using g = foo();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js.snap
new file mode 100644
index 00000000000..5668a7e595d
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-duplicate-using-bindings.js.snap
@@ -0,0 +1,146 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/invalid-duplicate-using-bindings.js
+---
+
+# Input
+
+```js
+{
+ using f, f = foo();
+}
+{
+ using g = foo();
+ using g = foo();
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,8 +1,10 @@
+ {
+- using f,
+- f = foo();
++ using;
++ f, (f = foo());
+ }
+ {
+- using g = foo();
+- using g = foo();
++ using;
++ g = foo();
++ using;
++ g = foo();
+ }
+```
+
+# Output
+
+```js
+{
+ using;
+ f, (f = foo());
+}
+{
+ using;
+ g = foo();
+ using;
+ g = foo();
+}
+```
+
+# Errors
+```
+invalid-duplicate-using-bindings.js:2:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ {
+ > 2 │ using f, f = foo();
+ │ ^
+ 3 │ }
+ 4 │ {
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ {
+ > 2 │ using f, f = foo();
+ │ ^
+ 3 │ }
+ 4 │ {
+
+ i ...Which is required to end this statement
+
+ 1 │ {
+ > 2 │ using f, f = foo();
+ │ ^^^^^^^
+ 3 │ }
+ 4 │ {
+
+invalid-duplicate-using-bindings.js:5:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 3 │ }
+ 4 │ {
+ > 5 │ using g = foo();
+ │ ^
+ 6 │ using g = foo();
+ 7 │ }
+
+ i An explicit or implicit semicolon is expected here...
+
+ 3 │ }
+ 4 │ {
+ > 5 │ using g = foo();
+ │ ^
+ 6 │ using g = foo();
+ 7 │ }
+
+ i ...Which is required to end this statement
+
+ 3 │ }
+ 4 │ {
+ > 5 │ using g = foo();
+ │ ^^^^^^^
+ 6 │ using g = foo();
+ 7 │ }
+
+invalid-duplicate-using-bindings.js:6:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 4 │ {
+ 5 │ using g = foo();
+ > 6 │ using g = foo();
+ │ ^
+ 7 │ }
+ 8 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 4 │ {
+ 5 │ using g = foo();
+ > 6 │ using g = foo();
+ │ ^
+ 7 │ }
+ 8 │
+
+ i ...Which is required to end this statement
+
+ 4 │ {
+ 5 │ using g = foo();
+ > 6 │ using g = foo();
+ │ ^^^^^^^
+ 7 │ }
+ 8 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js
new file mode 100644
index 00000000000..e33689ba708
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js
@@ -0,0 +1 @@
+using x = bar();
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js.prettier-snap
new file mode 100644
index 00000000000..e33689ba708
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js.prettier-snap
@@ -0,0 +1 @@
+using x = bar();
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js.snap
new file mode 100644
index 00000000000..96005128f56
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/invalid-script-top-level-using-binding.js.snap
@@ -0,0 +1,57 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/invalid-script-top-level-using-binding.js
+---
+
+# Input
+
+```js
+using x = bar();
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1 +1,2 @@
+-using x = bar();
++using;
++x = bar();
+```
+
+# Output
+
+```js
+using;
+x = bar();
+```
+
+# Errors
+```
+invalid-script-top-level-using-binding.js:1:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ using x = bar();
+ │ ^
+ 2 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ using x = bar();
+ │ ^
+ 2 │
+
+ i ...Which is required to end this statement
+
+ > 1 │ using x = bar();
+ │ ^^^^^^^
+ 2 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js
new file mode 100644
index 00000000000..508806aee5c
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js
@@ -0,0 +1,7 @@
+{
+ using /* 1 */ a = foo(), /* 2 */ b = foo()
+}
+
+for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+
+for(using /* 1 */ foo of bar());
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js.prettier-snap
new file mode 100644
index 00000000000..3d611cf61a6
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js.prettier-snap
@@ -0,0 +1,8 @@
+{
+ using /* 1 */ a = foo(),
+ /* 2 */ b = foo();
+}
+
+for (using /* 1 */ a = foo(), /* 2 */ b = foo(); ; );
+
+for (using /* 1 */ foo of bar());
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js.snap
new file mode 100644
index 00000000000..81b290fa376
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/using-declarations.js.snap
@@ -0,0 +1,203 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/using-declarations.js
+---
+
+# Input
+
+```js
+{
+ using /* 1 */ a = foo(), /* 2 */ b = foo()
+}
+
+for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+
+for(using /* 1 */ foo of bar());
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,8 +1,10 @@
+ {
+- using /* 1 */ a = foo(),
+- /* 2 */ b = foo();
++ using; /* 1 */
++ (a = foo()), /* 2 */ (b = foo());
+ }
+
+-for (using /* 1 */ a = foo(), /* 2 */ b = foo(); ; );
++for(using /* 1 */ a = foo(), /* 2 */ b = foo();;
++)
+
+-for (using /* 1 */ foo of bar());
++for(using /* 1 */ foo of bar()
++)
+```
+
+# Output
+
+```js
+{
+ using; /* 1 */
+ (a = foo()), /* 2 */ (b = foo());
+}
+
+for(using /* 1 */ a = foo(), /* 2 */ b = foo();;
+)
+
+for(using /* 1 */ foo of bar()
+)
+```
+
+# Errors
+```
+using-declarations.js:2:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ {
+ > 2 │ using /* 1 */ a = foo(), /* 2 */ b = foo()
+ │ ^
+ 3 │ }
+ 4 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ {
+ > 2 │ using /* 1 */ a = foo(), /* 2 */ b = foo()
+ │ ^
+ 3 │ }
+ 4 │
+
+ i ...Which is required to end this statement
+
+ 1 │ {
+ > 2 │ using /* 1 */ a = foo(), /* 2 */ b = foo()
+ │ ^^^^^^^^^^^^^^^
+ 3 │ }
+ 4 │
+
+using-declarations.js:5:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `a`
+
+ 3 │ }
+ 4 │
+ > 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ │ ^
+ 6 │
+ 7 │ for(using /* 1 */ foo of bar());
+
+ i Remove a
+
+using-declarations.js:5:48 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected an expression but instead found ';'
+
+ 3 │ }
+ 4 │
+ > 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ │ ^
+ 6 │
+ 7 │ for(using /* 1 */ foo of bar());
+
+ i Expected an expression here
+
+ 3 │ }
+ 4 │
+ > 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ │ ^
+ 6 │
+ 7 │ for(using /* 1 */ foo of bar());
+
+using-declarations.js:5:49 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected a statement but instead found ')'
+
+ 3 │ }
+ 4 │
+ > 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ │ ^
+ 6 │
+ 7 │ for(using /* 1 */ foo of bar());
+
+ i Expected a statement here
+
+ 3 │ }
+ 4 │
+ > 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ │ ^
+ 6 │
+ 7 │ for(using /* 1 */ foo of bar());
+
+using-declarations.js:7:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `foo`
+
+ 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ 6 │
+ > 7 │ for(using /* 1 */ foo of bar());
+ │ ^^^
+ 8 │
+
+ i Remove foo
+
+using-declarations.js:7:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `of`
+
+ 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ 6 │
+ > 7 │ for(using /* 1 */ foo of bar());
+ │ ^^
+ 8 │
+
+ i Remove of
+
+using-declarations.js:7:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `)` but instead found `bar`
+
+ 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ 6 │
+ > 7 │ for(using /* 1 */ foo of bar());
+ │ ^^^
+ 8 │
+
+ i Remove bar
+
+using-declarations.js:7:31 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ 6 │
+ > 7 │ for(using /* 1 */ foo of bar());
+ │ ^
+ 8 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ 6 │
+ > 7 │ for(using /* 1 */ foo of bar());
+ │ ^
+ 8 │
+
+ i ...Which is required to end this statement
+
+ 5 │ for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
+ 6 │
+ > 7 │ for(using /* 1 */ foo of bar());
+ │ ^^^^^^
+ 8 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-in.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-in.js
new file mode 100644
index 00000000000..7dcf9e0239b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-in.js
@@ -0,0 +1,3 @@
+async function f() {
+ await using in foo;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-in.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-in.js.prettier-snap
new file mode 100644
index 00000000000..79b06693268
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-in.js.prettier-snap
@@ -0,0 +1,3 @@
+async function f() {
+ (await using) in foo;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-instanceof.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-instanceof.js
new file mode 100644
index 00000000000..1818647e476
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-instanceof.js
@@ -0,0 +1,3 @@
+async function f() {
+ await using instanceof foo;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-instanceof.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-instanceof.js.prettier-snap
new file mode 100644
index 00000000000..10939279c0f
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using-instanceof.js.prettier-snap
@@ -0,0 +1,3 @@
+async function f() {
+ (await using) instanceof foo;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using.js
new file mode 100644
index 00000000000..f056de21db0
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using.js
@@ -0,0 +1,4 @@
+async function f() {
+ await using[x];
+ await using.x + await using(x) ? await using?.x : await using`x`;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using.js.prettier-snap
new file mode 100644
index 00000000000..c641386fc21
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-expr-using.js.prettier-snap
@@ -0,0 +1,4 @@
+async function f() {
+ await using[x];
+ (await using.x) + (await using(x)) ? await using?.x : await using`x`;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-asi-assignment.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-asi-assignment.js
new file mode 100644
index 00000000000..2dde3680d92
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-asi-assignment.js
@@ -0,0 +1,4 @@
+async function f() {
+ await using
+ using = h();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-asi-assignment.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-asi-assignment.js.prettier-snap
new file mode 100644
index 00000000000..81f8300f438
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-asi-assignment.js.prettier-snap
@@ -0,0 +1,4 @@
+async function f() {
+ await using;
+ using = h();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js
new file mode 100644
index 00000000000..321993e916c
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js
@@ -0,0 +1,3 @@
+async function f() {
+ await using basic = getReader();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js.prettier-snap
new file mode 100644
index 00000000000..321993e916c
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js.prettier-snap
@@ -0,0 +1,3 @@
+async function f() {
+ await using basic = getReader();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js.snap
new file mode 100644
index 00000000000..7caaf4d7beb
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-basic.js.snap
@@ -0,0 +1,69 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-await-using-binding-basic.js
+---
+
+# Input
+
+```js
+async function f() {
+ await using basic = getReader();
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,4 @@
+ async function f() {
+- await using basic = getReader();
++ await using;
++ basic = getReader();
+ }
+```
+
+# Output
+
+```js
+async function f() {
+ await using;
+ basic = getReader();
+}
+```
+
+# Errors
+```
+valid-await-using-binding-basic.js:2:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ async function f() {
+ > 2 │ await using basic = getReader();
+ │ ^^^^^
+ 3 │ }
+ 4 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ async function f() {
+ > 2 │ await using basic = getReader();
+ │ ^^^^^
+ 3 │ }
+ 4 │
+
+ i ...Which is required to end this statement
+
+ 1 │ async function f() {
+ > 2 │ await using basic = getReader();
+ │ ^^^^^^^^^^^^^^^^^
+ 3 │ }
+ 4 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js
new file mode 100644
index 00000000000..76af5903fa7
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js
@@ -0,0 +1,3 @@
+async function f() {
+ await using \u0061b = c;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js.prettier-snap
new file mode 100644
index 00000000000..18af5d75ab9
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js.prettier-snap
@@ -0,0 +1,3 @@
+async function f() {
+ await using ab = c;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js.snap
new file mode 100644
index 00000000000..67d016a39b8
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-escaped.js.snap
@@ -0,0 +1,69 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-await-using-binding-escaped.js
+---
+
+# Input
+
+```js
+async function f() {
+ await using \u0061b = c;
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,4 @@
+ async function f() {
+- await using ab = c;
++ await using;
++ \u0061b = c;
+ }
+```
+
+# Output
+
+```js
+async function f() {
+ await using;
+ \u0061b = c;
+}
+```
+
+# Errors
+```
+valid-await-using-binding-escaped.js:2:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ async function f() {
+ > 2 │ await using \u0061b = c;
+ │ ^^^^^^^
+ 3 │ }
+ 4 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ async function f() {
+ > 2 │ await using \u0061b = c;
+ │ ^^^^^^^
+ 3 │ }
+ 4 │
+
+ i ...Which is required to end this statement
+
+ 1 │ async function f() {
+ > 2 │ await using \u0061b = c;
+ │ ^^^^^^^^^^^^^^^^^^^
+ 3 │ }
+ 4 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js
new file mode 100644
index 00000000000..cbf4ce25199
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js
@@ -0,0 +1,3 @@
+async function f() {
+ await using 𠮷 = foo();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js.prettier-snap
new file mode 100644
index 00000000000..cbf4ce25199
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js.prettier-snap
@@ -0,0 +1,3 @@
+async function f() {
+ await using 𠮷 = foo();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js.snap
new file mode 100644
index 00000000000..7b3be0333ea
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-non-bmp.js.snap
@@ -0,0 +1,69 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-await-using-binding-non-bmp.js
+---
+
+# Input
+
+```js
+async function f() {
+ await using 𠮷 = foo();
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,4 @@
+ async function f() {
+- await using 𠮷 = foo();
++ await using;
++ 𠮷 = foo();
+ }
+```
+
+# Output
+
+```js
+async function f() {
+ await using;
+ 𠮷 = foo();
+}
+```
+
+# Errors
+```
+valid-await-using-binding-non-bmp.js:2:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ async function f() {
+ > 2 │ await using 𠮷 = foo();
+ │ ^^
+ 3 │ }
+ 4 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ async function f() {
+ > 2 │ await using 𠮷 = foo();
+ │ ^^
+ 3 │ }
+ 4 │
+
+ i ...Which is required to end this statement
+
+ 1 │ async function f() {
+ > 2 │ await using 𠮷 = foo();
+ │ ^^^^^^^^^^^^^^
+ 3 │ }
+ 4 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js
new file mode 100644
index 00000000000..fd4e32547db
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js
@@ -0,0 +1,4 @@
+async function f() {
+ await using using = of;
+ for (await using using of of);
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js.prettier-snap
new file mode 100644
index 00000000000..fd4e32547db
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js.prettier-snap
@@ -0,0 +1,4 @@
+async function f() {
+ await using using = of;
+ for (await using using of of);
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js.snap
new file mode 100644
index 00000000000..effec5fc5b1
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-binding-using.js.snap
@@ -0,0 +1,143 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-await-using-binding-using.js
+---
+
+# Input
+
+```js
+async function f() {
+ await using using = of;
+ for (await using using of of);
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,4 +1,6 @@
+ async function f() {
+- await using using = of;
+- for (await using using of of);
++ await using;
++ using = of;
++ for (await using using of of
++ )
+ }
+```
+
+# Output
+
+```js
+async function f() {
+ await using;
+ using = of;
+ for (await using using of of
+ )
+}
+```
+
+# Errors
+```
+valid-await-using-binding-using.js:2:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ async function f() {
+ > 2 │ await using using = of;
+ │ ^^^^^
+ 3 │ for (await using using of of);
+ 4 │ }
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ async function f() {
+ > 2 │ await using using = of;
+ │ ^^^^^
+ 3 │ for (await using using of of);
+ 4 │ }
+
+ i ...Which is required to end this statement
+
+ 1 │ async function f() {
+ > 2 │ await using using = of;
+ │ ^^^^^^^^^^^^^^^^^
+ 3 │ for (await using using of of);
+ 4 │ }
+
+valid-await-using-binding-using.js:3:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `using`
+
+ 1 │ async function f() {
+ 2 │ await using using = of;
+ > 3 │ for (await using using of of);
+ │ ^^^^^
+ 4 │ }
+ 5 │
+
+ i Remove using
+
+valid-await-using-binding-using.js:3:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `of`
+
+ 1 │ async function f() {
+ 2 │ await using using = of;
+ > 3 │ for (await using using of of);
+ │ ^^
+ 4 │ }
+ 5 │
+
+ i Remove of
+
+valid-await-using-binding-using.js:3:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `)` but instead found `of`
+
+ 1 │ async function f() {
+ 2 │ await using using = of;
+ > 3 │ for (await using using of of);
+ │ ^^
+ 4 │ }
+ 5 │
+
+ i Remove of
+
+valid-await-using-binding-using.js:3:31 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ async function f() {
+ 2 │ await using using = of;
+ > 3 │ for (await using using of of);
+ │ ^
+ 4 │ }
+ 5 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ async function f() {
+ 2 │ await using using = of;
+ > 3 │ for (await using using of of);
+ │ ^
+ 4 │ }
+ 5 │
+
+ i ...Which is required to end this statement
+
+ 1 │ async function f() {
+ 2 │ await using using = of;
+ > 3 │ for (await using using of of);
+ │ ^^^
+ 4 │ }
+ 5 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js
new file mode 100644
index 00000000000..3ce48f45b7b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js
@@ -0,0 +1,14 @@
+async function f() {
+{
+ /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
+}
+{
+ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
+}
+{
+ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
+}
+{
+ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+}
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js.prettier-snap
new file mode 100644
index 00000000000..c3447f172a9
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js.prettier-snap
@@ -0,0 +1,19 @@
+async function f() {
+ {
+ /*0*/ await using /*1*/ /*2*/ b /*3*/ = /*4*/ f(); /*5*/
+ }
+ {
+ /*0*/ for (
+ /*1*/ /*2*/ await using /*3*/ /*4*/ b /*5*/ =
+ /*6*/ x /*7*/ /*8*/ /*9*/ /*10*/;
+ ;
+
+ );
+ }
+ {
+ /*0*/ for (/*1*/ /*2*/ await using /*3*/ /*4*/ b /*5*/ of /*6*/ x /*7*/ /*8*/);
+ }
+ {
+ /*0*/ for await (/*1*/ /*2*/ /*3*/ await using /*4*/ /*5*/ b /*6*/ of /*7*/ x /*8*/ /*9*/);
+ }
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js.snap
new file mode 100644
index 00000000000..361e5f66c1a
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-await-using-comments.js.snap
@@ -0,0 +1,357 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-await-using-comments.js
+---
+
+# Input
+
+```js
+async function f() {
+{
+ /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
+}
+{
+ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
+}
+{
+ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
+}
+{
+ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+}
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,19 +1,18 @@
+ async function f() {
+ {
+- /*0*/ await using /*1*/ /*2*/ b /*3*/ = /*4*/ f(); /*5*/
++ /*0*/ await /*1*/ using; /*2*/
++ b /*3*/ = /*4*/ f() /*5*/;
+ }
+ {
+- /*0*/ for (
+- /*1*/ /*2*/ await using /*3*/ /*4*/ b /*5*/ =
+- /*6*/ x /*7*/ /*8*/ /*9*/ /*10*/;
+- ;
+-
+- );
++ /*0*/ for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/; /*9*/
++ ) /*10*/
+ }
+ {
+- /*0*/ for (/*1*/ /*2*/ await using /*3*/ /*4*/ b /*5*/ of /*6*/ x /*7*/ /*8*/);
++ /*0*/ for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x /*7*/
++ ) /*8*/
+ }
+ {
+- /*0*/ for await (/*1*/ /*2*/ /*3*/ await using /*4*/ /*5*/ b /*6*/ of /*7*/ x /*8*/ /*9*/);
++ /*0*/ for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x /*8*/
++ ) /*9*/
+ }
+ }
+```
+
+# Output
+
+```js
+async function f() {
+ {
+ /*0*/ await /*1*/ using; /*2*/
+ b /*3*/ = /*4*/ f() /*5*/;
+ }
+ {
+ /*0*/ for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/; /*9*/
+ ) /*10*/
+ }
+ {
+ /*0*/ for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x /*7*/
+ ) /*8*/
+ }
+ {
+ /*0*/ for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x /*8*/
+ ) /*9*/
+ }
+}
+```
+
+# Errors
+```
+valid-await-using-comments.js:3:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ async function f() {
+ 2 │ {
+ > 3 │ /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
+ │ ^
+ 4 │ }
+ 5 │ {
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ async function f() {
+ 2 │ {
+ > 3 │ /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
+ │ ^
+ 4 │ }
+ 5 │ {
+
+ i ...Which is required to end this statement
+
+ 1 │ async function f() {
+ 2 │ {
+ > 3 │ /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
+ │ ^^^^^^^^^^^^^^^^^^^^^
+ 4 │ }
+ 5 │ {
+
+valid-await-using-comments.js:6:42 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `b`
+
+ 4 │ }
+ 5 │ {
+ > 6 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
+ │ ^
+ 7 │ }
+ 8 │ {
+
+ i Remove b
+
+valid-await-using-comments.js:6:66 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected an expression but instead found ';'
+
+ 4 │ }
+ 5 │ {
+ > 6 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
+ │ ^
+ 7 │ }
+ 8 │ {
+
+ i Expected an expression here
+
+ 4 │ }
+ 5 │ {
+ > 6 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
+ │ ^
+ 7 │ }
+ 8 │ {
+
+valid-await-using-comments.js:6:72 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected a statement but instead found ')'
+
+ 4 │ }
+ 5 │ {
+ > 6 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
+ │ ^
+ 7 │ }
+ 8 │ {
+
+ i Expected a statement here
+
+ 4 │ }
+ 5 │ {
+ > 6 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
+ │ ^
+ 7 │ }
+ 8 │ {
+
+valid-await-using-comments.js:9:42 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `b`
+
+ 7 │ }
+ 8 │ {
+ > 9 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
+ │ ^
+ 10 │ }
+ 11 │ {
+
+ i Remove b
+
+valid-await-using-comments.js:9:48 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `of`
+
+ 7 │ }
+ 8 │ {
+ > 9 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
+ │ ^^
+ 10 │ }
+ 11 │ {
+
+ i Remove of
+
+valid-await-using-comments.js:9:55 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `)` but instead found `x`
+
+ 7 │ }
+ 8 │ {
+ > 9 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
+ │ ^
+ 10 │ }
+ 11 │ {
+
+ i Remove x
+
+valid-await-using-comments.js:9:61 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 7 │ }
+ 8 │ {
+ > 9 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
+ │ ^
+ 10 │ }
+ 11 │ {
+
+ i An explicit or implicit semicolon is expected here...
+
+ 7 │ }
+ 8 │ {
+ > 9 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
+ │ ^
+ 10 │ }
+ 11 │ {
+
+ i ...Which is required to end this statement
+
+ 7 │ }
+ 8 │ {
+ > 9 │ /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
+ │ ^^^^^^^
+ 10 │ }
+ 11 │ {
+
+valid-await-using-comments.js:12:52 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `b`
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^
+ 13 │ }
+ 14 │ }
+
+ i Remove b
+
+valid-await-using-comments.js:12:58 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `of`
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^^
+ 13 │ }
+ 14 │ }
+
+ i Remove of
+
+valid-await-using-comments.js:12:65 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `)` but instead found `x`
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^
+ 13 │ }
+ 14 │ }
+
+ i Remove x
+
+valid-await-using-comments.js:12:71 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^
+ 13 │ }
+ 14 │ }
+
+ i An explicit or implicit semicolon is expected here...
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^
+ 13 │ }
+ 14 │ }
+
+ i ...Which is required to end this statement
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^^^^^^^
+ 13 │ }
+ 14 │ }
+
+valid-await-using-comments.js:12:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × await can only be used in conjunction with `for...of` statements
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^^^^^
+ 13 │ }
+ 14 │ }
+
+ i Remove the await here
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^^^^^
+ 13 │ }
+ 14 │ }
+
+ i or convert this to a `for...of` statement
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ 13 │ }
+ 14 │ }
+
+valid-await-using-comments.js:12:71 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected a statement but instead found ')'
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^
+ 13 │ }
+ 14 │ }
+
+ i Expected a statement here
+
+ 10 │ }
+ 11 │ {
+ > 12 │ /*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
+ │ ^
+ 13 │ }
+ 14 │ }
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-await-using-binding-escaped-of-of.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-await-using-binding-escaped-of-of.js
new file mode 100644
index 00000000000..a44a6abe349
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-await-using-binding-escaped-of-of.js
@@ -0,0 +1,2 @@
+// TODO: Fix this test
+// for await (using \u006ff of of);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-await-using-binding-escaped-of-of.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-await-using-binding-escaped-of-of.js.prettier-snap
new file mode 100644
index 00000000000..a44a6abe349
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-await-using-binding-escaped-of-of.js.prettier-snap
@@ -0,0 +1,2 @@
+// TODO: Fix this test
+// for await (using \u006ff of of);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-escaped-of-of.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-escaped-of-of.js
new file mode 100644
index 00000000000..c4c021078a6
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-escaped-of-of.js
@@ -0,0 +1,2 @@
+// TODO: Fix this test
+// for (using o\u0066 of of);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-escaped-of-of.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-escaped-of-of.js.prettier-snap
new file mode 100644
index 00000000000..c4c021078a6
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-escaped-of-of.js.prettier-snap
@@ -0,0 +1,2 @@
+// TODO: Fix this test
+// for (using o\u0066 of of);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js
new file mode 100644
index 00000000000..4efb8f85a6f
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js
@@ -0,0 +1,4 @@
+async function f() {
+ for (await using of of of);
+ for await (await using of of of);
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js.prettier-snap
new file mode 100644
index 00000000000..4efb8f85a6f
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js.prettier-snap
@@ -0,0 +1,4 @@
+async function f() {
+ for (await using of of of);
+ for await (await using of of of);
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js.snap
new file mode 100644
index 00000000000..7485692e758
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-binding-of-of.js.snap
@@ -0,0 +1,154 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-for-using-binding-of-of.js
+---
+
+# Input
+
+```js
+async function f() {
+ for (await using of of of);
+ for await (await using of of of);
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,4 +1,6 @@
+ async function f() {
+- for (await using of of of);
+- for await (await using of of of);
++ for (await using of of of
++ )
++ for await (await using of of of
++ )
+ }
+```
+
+# Output
+
+```js
+async function f() {
+ for (await using of of of
+ )
+ for await (await using of of of
+ )
+}
+```
+
+# Errors
+```
+valid-for-using-binding-of-of.js:2:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Invalid assignment to `await using`
+
+ 1 │ async function f() {
+ > 2 │ for (await using of of of);
+ │ ^^^^^^^^^^^
+ 3 │ for await (await using of of of);
+ 4 │ }
+
+ i This expression cannot be assigned to
+
+valid-for-using-binding-of-of.js:2:26 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `)` but instead found `of`
+
+ 1 │ async function f() {
+ > 2 │ for (await using of of of);
+ │ ^^
+ 3 │ for await (await using of of of);
+ 4 │ }
+
+ i Remove of
+
+valid-for-using-binding-of-of.js:2:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ async function f() {
+ > 2 │ for (await using of of of);
+ │ ^
+ 3 │ for await (await using of of of);
+ 4 │ }
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ async function f() {
+ > 2 │ for (await using of of of);
+ │ ^
+ 3 │ for await (await using of of of);
+ 4 │ }
+
+ i ...Which is required to end this statement
+
+ 1 │ async function f() {
+ > 2 │ for (await using of of of);
+ │ ^^^
+ 3 │ for await (await using of of of);
+ 4 │ }
+
+valid-for-using-binding-of-of.js:3:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Invalid assignment to `await using`
+
+ 1 │ async function f() {
+ 2 │ for (await using of of of);
+ > 3 │ for await (await using of of of);
+ │ ^^^^^^^^^^^
+ 4 │ }
+ 5 │
+
+ i This expression cannot be assigned to
+
+valid-for-using-binding-of-of.js:3:32 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `)` but instead found `of`
+
+ 1 │ async function f() {
+ 2 │ for (await using of of of);
+ > 3 │ for await (await using of of of);
+ │ ^^
+ 4 │ }
+ 5 │
+
+ i Remove of
+
+valid-for-using-binding-of-of.js:3:34 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ async function f() {
+ 2 │ for (await using of of of);
+ > 3 │ for await (await using of of of);
+ │ ^
+ 4 │ }
+ 5 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ async function f() {
+ 2 │ for (await using of of of);
+ > 3 │ for await (await using of of of);
+ │ ^
+ 4 │ }
+ 5 │
+
+ i ...Which is required to end this statement
+
+ 1 │ async function f() {
+ 2 │ for (await using of of of);
+ > 3 │ for await (await using of of of);
+ │ ^^^
+ 4 │ }
+ 5 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js
new file mode 100644
index 00000000000..a13b51758dc
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js
@@ -0,0 +1,3 @@
+async function f() {
+ for (await using basic = reader();;);
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js.prettier-snap
new file mode 100644
index 00000000000..a0849041d56
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js.prettier-snap
@@ -0,0 +1,3 @@
+async function f() {
+ for (await using basic = reader(); ; );
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js.snap
new file mode 100644
index 00000000000..c6177852b57
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-for-using-declaration.js.snap
@@ -0,0 +1,91 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-for-using-declaration.js
+---
+
+# Input
+
+```js
+async function f() {
+ for (await using basic = reader();;);
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,4 @@
+ async function f() {
+- for (await using basic = reader(); ; );
++ for (await using basic = reader();;
++ )
+ }
+```
+
+# Output
+
+```js
+async function f() {
+ for (await using basic = reader();;
+ )
+}
+```
+
+# Errors
+```
+valid-for-using-declaration.js:2:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `basic`
+
+ 1 │ async function f() {
+ > 2 │ for (await using basic = reader();;);
+ │ ^^^^^
+ 3 │ }
+ 4 │
+
+ i Remove basic
+
+valid-for-using-declaration.js:2:37 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected an expression but instead found ';'
+
+ 1 │ async function f() {
+ > 2 │ for (await using basic = reader();;);
+ │ ^
+ 3 │ }
+ 4 │
+
+ i Expected an expression here
+
+ 1 │ async function f() {
+ > 2 │ for (await using basic = reader();;);
+ │ ^
+ 3 │ }
+ 4 │
+
+valid-for-using-declaration.js:2:38 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected a statement but instead found ')'
+
+ 1 │ async function f() {
+ > 2 │ for (await using basic = reader();;);
+ │ ^
+ 3 │ }
+ 4 │
+
+ i Expected a statement here
+
+ 1 │ async function f() {
+ > 2 │ for (await using basic = reader();;);
+ │ ^
+ 3 │ }
+ 4 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js
new file mode 100644
index 00000000000..fffa04d7c7a
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js
@@ -0,0 +1,3 @@
+const m = module {
+ await using foo = bar();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js.prettier-snap
new file mode 100644
index 00000000000..c9714f2ebff
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js.prettier-snap
@@ -0,0 +1,3 @@
+const m = module {
+ await using foo = bar();
+};
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js.snap
new file mode 100644
index 00000000000..08f41b3f365
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js.snap
@@ -0,0 +1,96 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js
+---
+
+# Input
+
+```js
+const m = module {
+ await using foo = bar();
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,5 @@
+-const m = module {
+- await using foo = bar();
+-};
++const m = module;
++{
++ await using;
++ foo = bar();
++}
+```
+
+# Output
+
+```js
+const m = module;
+{
+ await using;
+ foo = bar();
+}
+```
+
+# Errors
+```
+valid-module-block-top-level-await-using-binding.js:1:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ const m = module {
+ │ ^
+ 2 │ await using foo = bar();
+ 3 │ }
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ const m = module {
+ │ ^
+ 2 │ await using foo = bar();
+ 3 │ }
+
+ i ...Which is required to end this statement
+
+ > 1 │ const m = module {
+ │ ^^^^^^^^^^^^^^^^^
+ 2 │ await using foo = bar();
+ 3 │ }
+
+valid-module-block-top-level-await-using-binding.js:2:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ const m = module {
+ > 2 │ await using foo = bar();
+ │ ^^^
+ 3 │ }
+ 4 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ const m = module {
+ > 2 │ await using foo = bar();
+ │ ^^^
+ 3 │ }
+ 4 │
+
+ i ...Which is required to end this statement
+
+ 1 │ const m = module {
+ > 2 │ await using foo = bar();
+ │ ^^^^^^^^^^^^^^^
+ 3 │ }
+ 4 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js
new file mode 100644
index 00000000000..b9c213bf2e9
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js
@@ -0,0 +1,3 @@
+module {
+ using foo = bar();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js.prettier-snap
new file mode 100644
index 00000000000..49449a7deaf
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js.prettier-snap
@@ -0,0 +1,3 @@
+module {
+ using foo = bar();
+};
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js.snap
new file mode 100644
index 00000000000..6e7b6961e08
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-module-block-top-level-using-binding.js.snap
@@ -0,0 +1,96 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-module-block-top-level-using-binding.js
+---
+
+# Input
+
+```js
+module {
+ using foo = bar();
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,5 @@
+-module {
+- using foo = bar();
+-};
++module;
++{
++ using;
++ foo = bar();
++}
+```
+
+# Output
+
+```js
+module;
+{
+ using;
+ foo = bar();
+}
+```
+
+# Errors
+```
+valid-module-block-top-level-using-binding.js:1:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ module {
+ │ ^
+ 2 │ using foo = bar();
+ 3 │ }
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ module {
+ │ ^
+ 2 │ using foo = bar();
+ 3 │ }
+
+ i ...Which is required to end this statement
+
+ > 1 │ module {
+ │ ^^^^^^^^
+ 2 │ using foo = bar();
+ 3 │ }
+
+valid-module-block-top-level-using-binding.js:2:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ module {
+ > 2 │ using foo = bar();
+ │ ^^^
+ 3 │ }
+ 4 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ module {
+ > 2 │ using foo = bar();
+ │ ^^^
+ 3 │ }
+ 4 │
+
+ i ...Which is required to end this statement
+
+ 1 │ module {
+ > 2 │ using foo = bar();
+ │ ^^^^^^^^^
+ 3 │ }
+ 4 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-computed-member.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-computed-member.js
new file mode 100644
index 00000000000..76021eb0257
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-computed-member.js
@@ -0,0 +1,2 @@
+using [x] = 0;
+for (using [x] of []);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-computed-member.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-computed-member.js.prettier-snap
new file mode 100644
index 00000000000..34fb1308b87
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-computed-member.js.prettier-snap
@@ -0,0 +1,2 @@
+using[x] = 0;
+for (using[x] of []);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-expression-statement.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-expression-statement.js
new file mode 100644
index 00000000000..8261b5a2e0b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-expression-statement.js
@@ -0,0 +1,2 @@
+using
+reader = getReader()
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-expression-statement.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-expression-statement.js.prettier-snap
new file mode 100644
index 00000000000..8372ce30f8e
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-expression-statement.js.prettier-snap
@@ -0,0 +1,2 @@
+using;
+reader = getReader();
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-await-of.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-await-of.js
new file mode 100644
index 00000000000..9c1ceb473d7
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-await-of.js
@@ -0,0 +1 @@
+for await (using of of);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-await-of.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-await-of.js.prettier-snap
new file mode 100644
index 00000000000..9c1ceb473d7
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-await-of.js.prettier-snap
@@ -0,0 +1 @@
+for await (using of of);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-in.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-in.js
new file mode 100644
index 00000000000..43f6861ee62
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-in.js
@@ -0,0 +1,4 @@
+for (using in []);
+for (using.foo in []);
+for (using().foo in []);
+for (using``.foo in []);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-in.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-in.js.prettier-snap
new file mode 100644
index 00000000000..43f6861ee62
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-in.js.prettier-snap
@@ -0,0 +1,4 @@
+for (using in []);
+for (using.foo in []);
+for (using().foo in []);
+for (using``.foo in []);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-init.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-init.js
new file mode 100644
index 00000000000..e2115da2fea
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-init.js
@@ -0,0 +1,3 @@
+for (
+ using;
+ reader = getReader(););
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-init.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-init.js.prettier-snap
new file mode 100644
index 00000000000..c5bb4f6ae62
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-init.js.prettier-snap
@@ -0,0 +1 @@
+for (using; (reader = getReader()); );
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-of.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-of.js
new file mode 100644
index 00000000000..098c11b0561
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-of.js
@@ -0,0 +1,4 @@
+for (using of of);
+for (using.foo of of);
+for (using().foo of of);
+for (using``.foo of of);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-of.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-of.js.prettier-snap
new file mode 100644
index 00000000000..098c11b0561
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-for-of.js.prettier-snap
@@ -0,0 +1,4 @@
+for (using of of);
+for (using.foo of of);
+for (using().foo of of);
+for (using``.foo of of);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-in.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-in.js
new file mode 100644
index 00000000000..b7574f49047
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-in.js
@@ -0,0 +1 @@
+using in using instanceof using;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-in.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-in.js.prettier-snap
new file mode 100644
index 00000000000..b7574f49047
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-as-identifier-in.js.prettier-snap
@@ -0,0 +1 @@
+using in using instanceof using;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js
new file mode 100644
index 00000000000..9f8f2445bc6
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js
@@ -0,0 +1,3 @@
+{
+ using basic = getReader();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js.prettier-snap
new file mode 100644
index 00000000000..9f8f2445bc6
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js.prettier-snap
@@ -0,0 +1,3 @@
+{
+ using basic = getReader();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js.snap
new file mode 100644
index 00000000000..f93846ae677
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-basic.js.snap
@@ -0,0 +1,69 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-using-binding-basic.js
+---
+
+# Input
+
+```js
+{
+ using basic = getReader();
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,4 @@
+ {
+- using basic = getReader();
++ using;
++ basic = getReader();
+ }
+```
+
+# Output
+
+```js
+{
+ using;
+ basic = getReader();
+}
+```
+
+# Errors
+```
+valid-using-binding-basic.js:2:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ {
+ > 2 │ using basic = getReader();
+ │ ^^^^^
+ 3 │ }
+ 4 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ {
+ > 2 │ using basic = getReader();
+ │ ^^^^^
+ 3 │ }
+ 4 │
+
+ i ...Which is required to end this statement
+
+ 1 │ {
+ > 2 │ using basic = getReader();
+ │ ^^^^^^^^^^^
+ 3 │ }
+ 4 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js
new file mode 100644
index 00000000000..475887f4dbd
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js
@@ -0,0 +1 @@
+{ using \u0061b = c; }
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js.prettier-snap
new file mode 100644
index 00000000000..102208db652
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js.prettier-snap
@@ -0,0 +1,3 @@
+{
+ using ab = c;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js.snap
new file mode 100644
index 00000000000..e4a6c104b3d
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-escaped.js.snap
@@ -0,0 +1,61 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-using-binding-escaped.js
+---
+
+# Input
+
+```js
+{ using \u0061b = c; }
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,4 @@
+ {
+- using ab = c;
++ using;
++ \u0061b = c;
+ }
+```
+
+# Output
+
+```js
+{
+ using;
+ \u0061b = c;
+}
+```
+
+# Errors
+```
+valid-using-binding-escaped.js:1:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ { using \u0061b = c; }
+ │ ^^^^^^^
+ 2 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ { using \u0061b = c; }
+ │ ^^^^^^^
+ 2 │
+
+ i ...Which is required to end this statement
+
+ > 1 │ { using \u0061b = c; }
+ │ ^^^^^^^^^^^^^
+ 2 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js
new file mode 100644
index 00000000000..ff01e43dfd6
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js
@@ -0,0 +1 @@
+{ using 𠮷 = foo(); }
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js.prettier-snap
new file mode 100644
index 00000000000..f3b8568cdaa
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js.prettier-snap
@@ -0,0 +1,3 @@
+{
+ using 𠮷 = foo();
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js.snap
new file mode 100644
index 00000000000..c13065af8ce
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-non-bmp.js.snap
@@ -0,0 +1,61 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-using-binding-non-bmp.js
+---
+
+# Input
+
+```js
+{ using 𠮷 = foo(); }
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,3 +1,4 @@
+ {
+- using 𠮷 = foo();
++ using;
++ 𠮷 = foo();
+ }
+```
+
+# Output
+
+```js
+{
+ using;
+ 𠮷 = foo();
+}
+```
+
+# Errors
+```
+valid-using-binding-non-bmp.js:1:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ { using 𠮷 = foo(); }
+ │ ^^
+ 2 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ { using 𠮷 = foo(); }
+ │ ^^
+ 2 │
+
+ i ...Which is required to end this statement
+
+ > 1 │ { using 𠮷 = foo(); }
+ │ ^^^^^^^^
+ 2 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js
new file mode 100644
index 00000000000..62baf2a5e64
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js
@@ -0,0 +1,4 @@
+{
+ using using = of;
+ for (using using of of);
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js.prettier-snap
new file mode 100644
index 00000000000..62baf2a5e64
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js.prettier-snap
@@ -0,0 +1,4 @@
+{
+ using using = of;
+ for (using using of of);
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js.snap
new file mode 100644
index 00000000000..6e012e92e65
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/explicit-resource-management/valid-using-binding-using.js.snap
@@ -0,0 +1,143 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/explicit-resource-management/valid-using-binding-using.js
+---
+
+# Input
+
+```js
+{
+ using using = of;
+ for (using using of of);
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,4 +1,6 @@
+ {
+- using using = of;
+- for (using using of of);
++ using;
++ using = of;
++ for (using using of of
++ )
+ }
+```
+
+# Output
+
+```js
+{
+ using;
+ using = of;
+ for (using using of of
+ )
+}
+```
+
+# Errors
+```
+valid-using-binding-using.js:2:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ {
+ > 2 │ using using = of;
+ │ ^^^^^
+ 3 │ for (using using of of);
+ 4 │ }
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ {
+ > 2 │ using using = of;
+ │ ^^^^^
+ 3 │ for (using using of of);
+ 4 │ }
+
+ i ...Which is required to end this statement
+
+ 1 │ {
+ > 2 │ using using = of;
+ │ ^^^^^^^^^^^
+ 3 │ for (using using of of);
+ 4 │ }
+
+valid-using-binding-using.js:3:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `using`
+
+ 1 │ {
+ 2 │ using using = of;
+ > 3 │ for (using using of of);
+ │ ^^^^^
+ 4 │ }
+ 5 │
+
+ i Remove using
+
+valid-using-binding-using.js:3:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `;` but instead found `of`
+
+ 1 │ {
+ 2 │ using using = of;
+ > 3 │ for (using using of of);
+ │ ^^
+ 4 │ }
+ 5 │
+
+ i Remove of
+
+valid-using-binding-using.js:3:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `)` but instead found `of`
+
+ 1 │ {
+ 2 │ using using = of;
+ > 3 │ for (using using of of);
+ │ ^^
+ 4 │ }
+ 5 │
+
+ i Remove of
+
+valid-using-binding-using.js:3:25 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ 1 │ {
+ 2 │ using using = of;
+ > 3 │ for (using using of of);
+ │ ^
+ 4 │ }
+ 5 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ 1 │ {
+ 2 │ using using = of;
+ > 3 │ for (using using of of);
+ │ ^
+ 4 │ }
+ 5 │
+
+ i ...Which is required to end this statement
+
+ 1 │ {
+ 2 │ using using = of;
+ > 3 │ for (using using of of);
+ │ ^^^
+ 4 │ }
+ 5 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/function-comments/params-trail-comments.js b/crates/rome_js_formatter/tests/specs/prettier/js/function-comments/params-trail-comments.js
new file mode 100644
index 00000000000..baac237b880
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/function-comments/params-trail-comments.js
@@ -0,0 +1,24 @@
+function Foo(
+ bar
+ // Trailing comment
+) {}
+
+function Foo(
+ {bar}
+ // Trailing comment
+) {}
+
+function Foo(
+ [bar]
+ // Trailing comment
+) {}
+
+function Foo(
+ bar = 1
+ // Trailing comment
+) {}
+
+function Foo(
+ ...bar
+ // Trailing comment
+) {}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/function-comments/params-trail-comments.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/function-comments/params-trail-comments.js.prettier-snap
new file mode 100644
index 00000000000..4066784ef36
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/function-comments/params-trail-comments.js.prettier-snap
@@ -0,0 +1,24 @@
+function Foo(
+ bar,
+ // Trailing comment
+) {}
+
+function Foo(
+ { bar },
+ // Trailing comment
+) {}
+
+function Foo(
+ [bar],
+ // Trailing comment
+) {}
+
+function Foo(
+ bar = 1,
+ // Trailing comment
+) {}
+
+function Foo(
+ ...bar
+ // Trailing comment
+) {}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js b/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js
new file mode 100644
index 00000000000..4fbf5bdd004
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js
@@ -0,0 +1,47 @@
+function StatelessFunctionalComponent1({
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+} = {}) {
+}
+
+function StatelessFunctionalComponent2({
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+} = #{}) {
+}
+
+function StatelessFunctionalComponent3([
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+] = []) {
+}
+
+function StatelessFunctionalComponent4([
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+] = #[]) {
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js.prettier-snap
new file mode 100644
index 00000000000..e9db6776760
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js.prettier-snap
@@ -0,0 +1,43 @@
+function StatelessFunctionalComponent1({
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = "",
+ items = [],
+} = {}) {}
+
+function StatelessFunctionalComponent2({
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = "",
+ items = [],
+} = #{}) {}
+
+function StatelessFunctionalComponent3([
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = "",
+ items = [],
+] = []) {}
+
+function StatelessFunctionalComponent4([
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = "",
+ items = [],
+] = #[]) {}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js.snap
new file mode 100644
index 00000000000..5aca42ee7a2
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/function-single-destructuring/tuple-and-record.js.snap
@@ -0,0 +1,233 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/function-single-destructuring/tuple-and-record.js
+---
+
+# Input
+
+```js
+function StatelessFunctionalComponent1({
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+} = {}) {
+}
+
+function StatelessFunctionalComponent2({
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+} = #{}) {
+}
+
+function StatelessFunctionalComponent3([
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+] = []) {
+}
+
+function StatelessFunctionalComponent4([
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+] = #[]) {
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -16,9 +16,10 @@
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+- title = "",
++ title = '',
+ items = [],
+-} = #{}) {}
++} = #{}) {
++}
+
+ function StatelessFunctionalComponent3([
+ isActive = true,
+@@ -38,6 +39,7 @@
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+- title = "",
++ title = '',
+ items = [],
+-] = #[]) {}
++] = #[]) {
++}
+```
+
+# Output
+
+```js
+function StatelessFunctionalComponent1({
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = "",
+ items = [],
+} = {}) {}
+
+function StatelessFunctionalComponent2({
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+} = #{}) {
+}
+
+function StatelessFunctionalComponent3([
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = "",
+ items = [],
+] = []) {}
+
+function StatelessFunctionalComponent4([
+ isActive = true,
+ onFiltersUpdated = () => null,
+ onSelect = () => null,
+ onSubmitAndDeselect = () => null,
+ onCancel = () => null,
+ searchFilters = null,
+ title = '',
+ items = [],
+] = #[]) {
+}
+```
+
+# Errors
+```
+tuple-and-record.js:22:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected an identifier but instead found '{'
+
+ 20 │ title = '',
+ 21 │ items = [],
+ > 22 │ } = #{}) {
+ │ ^
+ 23 │ }
+ 24 │
+
+ i Expected an identifier here
+
+ 20 │ title = '',
+ 21 │ items = [],
+ > 22 │ } = #{}) {
+ │ ^
+ 23 │ }
+ 24 │
+
+tuple-and-record.js:22:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Private names are only allowed on the left side of a 'in' expression
+
+ 20 │ title = '',
+ 21 │ items = [],
+ > 22 │ } = #{}) {
+ │ ^
+ 23 │ }
+ 24 │
+
+tuple-and-record.js:22:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `,` but instead found `{`
+
+ 20 │ title = '',
+ 21 │ items = [],
+ > 22 │ } = #{}) {
+ │ ^
+ 23 │ }
+ 24 │
+
+ i Remove {
+
+tuple-and-record.js:46:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected an identifier but instead found '['
+
+ 44 │ title = '',
+ 45 │ items = [],
+ > 46 │ ] = #[]) {
+ │ ^
+ 47 │ }
+ 48 │
+
+ i Expected an identifier here
+
+ 44 │ title = '',
+ 45 │ items = [],
+ > 46 │ ] = #[]) {
+ │ ^
+ 47 │ }
+ 48 │
+
+tuple-and-record.js:46:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Private names are only allowed on the left side of a 'in' expression
+
+ 44 │ title = '',
+ 45 │ items = [],
+ > 46 │ ] = #[]) {
+ │ ^
+ 47 │ }
+ 48 │
+
+tuple-and-record.js:46:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `,` but instead found `[`
+
+ 44 │ title = '',
+ 45 │ items = [],
+ > 46 │ ] = #[]) {
+ │ ^
+ 47 │ }
+ 48 │
+
+ i Remove [
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js
new file mode 100644
index 00000000000..8d6863350e9
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js
@@ -0,0 +1,5 @@
+(
+ // prettier-ignore
+ @decorator
+ class {}
+);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js.prettier-snap
new file mode 100644
index 00000000000..d6dd4541c89
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js.prettier-snap
@@ -0,0 +1,5 @@
+// prettier-ignore
+(
+ @decorator
+ class {}
+);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js.snap
new file mode 100644
index 00000000000..86d0fd2f821
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/class-expression-decorator.js.snap
@@ -0,0 +1,42 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/ignore/class-expression-decorator.js
+---
+
+# Input
+
+```js
+(
+ // prettier-ignore
+ @decorator
+ class {}
+);
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,5 +1,5 @@
+-// prettier-ignore
+ (
++ // prettier-ignore
+ @decorator
+ class {}
+ );
+```
+
+# Output
+
+```js
+(
+ // prettier-ignore
+ @decorator
+ class {}
+);
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/decorator.js b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/decorator.js
new file mode 100644
index 00000000000..7d2b146ff35
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/decorator.js
@@ -0,0 +1,3 @@
+// prettier-ignore
+@decorator
+class A {}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/decorator.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/decorator.js.prettier-snap
new file mode 100644
index 00000000000..7d2b146ff35
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/decorator.js.prettier-snap
@@ -0,0 +1,3 @@
+// prettier-ignore
+@decorator
+class A {}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js
new file mode 100644
index 00000000000..8f1367c1772
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js
@@ -0,0 +1,20 @@
+function HelloWorld(x) {
+
+ (
+ // prettier-ignore
+ // eslint-disable-next-line
+ x.a |
+ x.b
+ ).call(null)
+
+}
+
+function HelloWorld(x) {
+ // prettier-ignore
+ (
+ // eslint-disable-next-line
+ x.a |
+ x.b
+ ).call(null)
+
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js.prettier-snap
new file mode 100644
index 00000000000..09d43769f46
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js.prettier-snap
@@ -0,0 +1,15 @@
+function HelloWorld(x) {
+ // prettier-ignore
+ // eslint-disable-next-line
+ (x.a |
+ x.b).call(null);
+}
+
+function HelloWorld(x) {
+ // prettier-ignore
+ (
+ // eslint-disable-next-line
+ x.a |
+ x.b
+ ).call(null)
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js.snap
new file mode 100644
index 00000000000..d6cdaea9e8e
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-11077.js.snap
@@ -0,0 +1,83 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/ignore/issue-11077.js
+---
+
+# Input
+
+```js
+function HelloWorld(x) {
+
+ (
+ // prettier-ignore
+ // eslint-disable-next-line
+ x.a |
+ x.b
+ ).call(null)
+
+}
+
+function HelloWorld(x) {
+ // prettier-ignore
+ (
+ // eslint-disable-next-line
+ x.a |
+ x.b
+ ).call(null)
+
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,12 +1,15 @@
+ function HelloWorld(x) {
+- // prettier-ignore
+- // eslint-disable-next-line
+- (x.a |
+- x.b).call(null);
++ (
++ // prettier-ignore
++ // eslint-disable-next-line
++ x.a |
++ x.b
++ ).call(null)
+ }
+
+ function HelloWorld(x) {
+ // prettier-ignore
++
+ (
+ // eslint-disable-next-line
+ x.a |
+```
+
+# Output
+
+```js
+function HelloWorld(x) {
+ (
+ // prettier-ignore
+ // eslint-disable-next-line
+ x.a |
+ x.b
+ ).call(null)
+}
+
+function HelloWorld(x) {
+ // prettier-ignore
+
+ (
+ // eslint-disable-next-line
+ x.a |
+ x.b
+ ).call(null)
+}
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js
new file mode 100644
index 00000000000..63bfb767b40
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js
@@ -0,0 +1,9 @@
+oneArgument(
+ // prettier-ignore
+ (0, 1)
+)
+
+a=(
+ // prettier-ignore
+ (0, 1)
+)
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js.prettier-snap
new file mode 100644
index 00000000000..8c8513d9a00
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js.prettier-snap
@@ -0,0 +1,8 @@
+oneArgument(
+ // prettier-ignore
+ (0, 1),
+);
+
+a =
+ // prettier-ignore
+ (0, 1);
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js.snap
new file mode 100644
index 00000000000..9098a05ad0b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-13737.js.snap
@@ -0,0 +1,54 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/ignore/issue-13737.js
+---
+
+# Input
+
+```js
+oneArgument(
+ // prettier-ignore
+ (0, 1)
+)
+
+a=(
+ // prettier-ignore
+ (0, 1)
+)
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -4,5 +4,7 @@
+ );
+
+ a =
+- // prettier-ignore
+- (0, 1);
++ (
++ // prettier-ignore
++ (0, 1)
++);
+```
+
+# Output
+
+```js
+oneArgument(
+ // prettier-ignore
+ (0, 1),
+);
+
+a =
+ (
+ // prettier-ignore
+ (0, 1)
+);
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js
new file mode 100644
index 00000000000..62ec236ce50
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js
@@ -0,0 +1,7 @@
+async function foo() {
+(
+ // prettier-ignore
+ // b
+ await thing()
+).blah
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js.prettier-snap
new file mode 100644
index 00000000000..b89f55e246b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js.prettier-snap
@@ -0,0 +1,5 @@
+async function foo() {
+ // prettier-ignore
+ // b
+ (await thing()).blah;
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js.snap
new file mode 100644
index 00000000000..8ca03c7695f
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-14404.js.snap
@@ -0,0 +1,50 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/ignore/issue-14404.js
+---
+
+# Input
+
+```js
+async function foo() {
+(
+ // prettier-ignore
+ // b
+ await thing()
+).blah
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,5 +1,7 @@
+ async function foo() {
+- // prettier-ignore
+- // b
+- (await thing()).blah;
++ (
++ // prettier-ignore
++ // b
++ await thing()
++).blah
+ }
+```
+
+# Output
+
+```js
+async function foo() {
+ (
+ // prettier-ignore
+ // b
+ await thing()
+).blah
+}
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9335.js b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9335.js
new file mode 100644
index 00000000000..51be980f896
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9335.js
@@ -0,0 +1,3 @@
+class foo extends
+ // prettier-ignore
+ f {}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9335.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9335.js.prettier-snap
new file mode 100644
index 00000000000..92aa99ddaba
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9335.js.prettier-snap
@@ -0,0 +1,3 @@
+class foo
+ // prettier-ignore
+ extends f {}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js
new file mode 100644
index 00000000000..8a51508ad52
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js
@@ -0,0 +1,11 @@
+export default function test() {
+ return {
+ matrix: // prettier-ignore
+ new Float32Array([
+ 0, 0,
+ 1, 0,
+ 1, 1,
+ 0, 1
+ ]),
+ };
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js.prettier-snap
new file mode 100644
index 00000000000..8a51508ad52
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js.prettier-snap
@@ -0,0 +1,11 @@
+export default function test() {
+ return {
+ matrix: // prettier-ignore
+ new Float32Array([
+ 0, 0,
+ 1, 0,
+ 1, 1,
+ 0, 1
+ ]),
+ };
+}
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js.snap
new file mode 100644
index 00000000000..8721e0b696f
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/issue-9877.js.snap
@@ -0,0 +1,55 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/ignore/issue-9877.js
+---
+
+# Input
+
+```js
+export default function test() {
+ return {
+ matrix: // prettier-ignore
+ new Float32Array([
+ 0, 0,
+ 1, 0,
+ 1, 1,
+ 0, 1
+ ]),
+ };
+}
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,11 +1,6 @@
+ export default function test() {
+ return {
+ matrix: // prettier-ignore
+- new Float32Array([
+- 0, 0,
+- 1, 0,
+- 1, 1,
+- 0, 1
+- ]),
++ new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
+ };
+ }
+```
+
+# Output
+
+```js
+export default function test() {
+ return {
+ matrix: // prettier-ignore
+ new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
+ };
+}
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/semi/asi.js b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/semi/asi.js
new file mode 100644
index 00000000000..94cb77939ef
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/semi/asi.js
@@ -0,0 +1,3 @@
+foo;
+// prettier-ignore
+[1].map();
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/ignore/semi/asi.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/semi/asi.js.prettier-snap
new file mode 100644
index 00000000000..94cb77939ef
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/ignore/semi/asi.js.prettier-snap
@@ -0,0 +1,3 @@
+foo;
+// prettier-ignore
+[1].map();
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/dynamic-import.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/dynamic-import.js
new file mode 100644
index 00000000000..717b72d4a84
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/dynamic-import.js
@@ -0,0 +1 @@
+import("./foo.json", { with: { type: "json" } });
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/dynamic-import.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/dynamic-import.js.prettier-snap
new file mode 100644
index 00000000000..717b72d4a84
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/dynamic-import.js.prettier-snap
@@ -0,0 +1 @@
+import("./foo.json", { with: { type: "json" } });
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js
new file mode 100644
index 00000000000..22cfde938db
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js
@@ -0,0 +1 @@
+export * as bar from "bar.json" with { }
\ No newline at end of file
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js.prettier-snap
new file mode 100644
index 00000000000..349c495478a
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js.prettier-snap
@@ -0,0 +1 @@
+export * as bar from "bar.json";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js.snap
new file mode 100644
index 00000000000..f5949dd2e80
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/empty.js.snap
@@ -0,0 +1,29 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/import-attributes/bracket-spacing/empty.js
+---
+
+# Input
+
+```js
+export * as bar from "bar.json" with { }
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1 +1 @@
+-export * as bar from "bar.json";
++export * as bar from "bar.json" with {};
+```
+
+# Output
+
+```js
+export * as bar from "bar.json" with {};
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/re-export.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/re-export.js
new file mode 100644
index 00000000000..12b98b761f4
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/re-export.js
@@ -0,0 +1 @@
+export { default as foo2 } from "foo.json" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/re-export.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/re-export.js.prettier-snap
new file mode 100644
index 00000000000..12b98b761f4
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/re-export.js.prettier-snap
@@ -0,0 +1 @@
+export { default as foo2 } from "foo.json" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/static-import.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/static-import.js
new file mode 100644
index 00000000000..7770ae1f06b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/static-import.js
@@ -0,0 +1 @@
+import json from "./foo.json" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/static-import.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/static-import.js.prettier-snap
new file mode 100644
index 00000000000..7770ae1f06b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/bracket-spacing/static-import.js.prettier-snap
@@ -0,0 +1 @@
+import json from "./foo.json" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/dynamic-import.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/dynamic-import.js
new file mode 100644
index 00000000000..717b72d4a84
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/dynamic-import.js
@@ -0,0 +1 @@
+import("./foo.json", { with: { type: "json" } });
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/dynamic-import.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/dynamic-import.js.prettier-snap
new file mode 100644
index 00000000000..717b72d4a84
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/dynamic-import.js.prettier-snap
@@ -0,0 +1 @@
+import("./foo.json", { with: { type: "json" } });
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js
new file mode 100644
index 00000000000..ab1ee6f33e4
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js
@@ -0,0 +1,7 @@
+export * as foo from "foo.json"
+export * as bar from "bar.json" with { }
+export * as baz from "baz.json" with { /* comment */ }
+
+import * as foo from "foo.json"
+import * as bar from "bar.json" with { }
+import * as baz from "baz.json" with { /* comment */ }
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js.prettier-snap
new file mode 100644
index 00000000000..6be0c7b7e06
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js.prettier-snap
@@ -0,0 +1,7 @@
+export * as foo from "foo.json";
+export * as bar from "bar.json";
+export * as baz from "baz.json" /* comment */;
+
+import * as foo from "foo.json";
+import * as bar from "bar.json";
+import * as baz from "baz.json" /* comment */;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js.snap
new file mode 100644
index 00000000000..222287bf5b1
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/empty.js.snap
@@ -0,0 +1,51 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/import-attributes/empty.js
+---
+
+# Input
+
+```js
+export * as foo from "foo.json"
+export * as bar from "bar.json" with { }
+export * as baz from "baz.json" with { /* comment */ }
+
+import * as foo from "foo.json"
+import * as bar from "bar.json" with { }
+import * as baz from "baz.json" with { /* comment */ }
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,7 +1,7 @@
+ export * as foo from "foo.json";
+-export * as bar from "bar.json";
+-export * as baz from "baz.json" /* comment */;
++export * as bar from "bar.json" with {};
++export * as baz from "baz.json" with { /* comment */ };
+
+ import * as foo from "foo.json";
+-import * as bar from "bar.json";
+-import * as baz from "baz.json" /* comment */;
++import * as bar from "bar.json" with {};
++import * as baz from "baz.json" with { /* comment */ };
+```
+
+# Output
+
+```js
+export * as foo from "foo.json";
+export * as bar from "bar.json" with {};
+export * as baz from "baz.json" with { /* comment */ };
+
+import * as foo from "foo.json";
+import * as bar from "bar.json" with {};
+import * as baz from "baz.json" with { /* comment */ };
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/multi-types.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/multi-types.js
new file mode 100644
index 00000000000..0f0e7115f30
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/multi-types.js
@@ -0,0 +1 @@
+import json from "./foo.json" with { type: "json", type: "bar" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/multi-types.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/multi-types.js.prettier-snap
new file mode 100644
index 00000000000..0f0e7115f30
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/multi-types.js.prettier-snap
@@ -0,0 +1 @@
+import json from "./foo.json" with { type: "json", type: "bar" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/non-type.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/non-type.js
new file mode 100644
index 00000000000..1858e49c202
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/non-type.js
@@ -0,0 +1 @@
+import foo from "foo.json" with { lazy: "true" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/non-type.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/non-type.js.prettier-snap
new file mode 100644
index 00000000000..1858e49c202
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/non-type.js.prettier-snap
@@ -0,0 +1 @@
+import foo from "foo.json" with { lazy: "true" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/re-export.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/re-export.js
new file mode 100644
index 00000000000..8b7f8a81728
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/re-export.js
@@ -0,0 +1,3 @@
+export { default as foo2 } from "foo.json" with { type: "json" };
+export * from "foo.json" with { type: "json" };
+export * as foo3 from "foo.json" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/re-export.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/re-export.js.prettier-snap
new file mode 100644
index 00000000000..8b7f8a81728
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/re-export.js.prettier-snap
@@ -0,0 +1,3 @@
+export { default as foo2 } from "foo.json" with { type: "json" };
+export * from "foo.json" with { type: "json" };
+export * as foo3 from "foo.json" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/static-import.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/static-import.js
new file mode 100644
index 00000000000..7770ae1f06b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/static-import.js
@@ -0,0 +1 @@
+import json from "./foo.json" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/static-import.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/static-import.js.prettier-snap
new file mode 100644
index 00000000000..7770ae1f06b
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/static-import.js.prettier-snap
@@ -0,0 +1 @@
+import json from "./foo.json" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/without-from.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/without-from.js
new file mode 100644
index 00000000000..5009c441a73
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/without-from.js
@@ -0,0 +1 @@
+import "foo" with { type: "json" }
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/without-from.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/without-from.js.prettier-snap
new file mode 100644
index 00000000000..97676575506
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-attributes/without-from.js.prettier-snap
@@ -0,0 +1 @@
+import "foo" with { type: "json" };
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js
new file mode 100644
index 00000000000..225520995e5
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js
@@ -0,0 +1 @@
+/* 0 */import /* 1 */module /* 2 */from /* 3 */from /* 4 */"./module.wasm"/* 5 */;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js.prettier-snap
new file mode 100644
index 00000000000..4a8174ac878
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js.prettier-snap
@@ -0,0 +1 @@
+/* 0 */ import module /* 1 */ /* 2 */ from /* 3 */ from /* 4 */ "./module.wasm" /* 5 */;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js.snap
new file mode 100644
index 00000000000..dd027e23260
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/comments.js.snap
@@ -0,0 +1,73 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/import-reflection/comments.js
+---
+
+# Input
+
+```js
+/* 0 */import /* 1 */module /* 2 */from /* 3 */from /* 4 */"./module.wasm"/* 5 */;
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1 +1,3 @@
+-/* 0 */ import module /* 1 */ /* 2 */ from /* 3 */ from /* 4 */ "./module.wasm" /* 5 */;
++/* 0 */ import /* 1 */module /* 2 */from /* 3 */
++from; /* 4 */
++("./module.wasm") /* 5 */;
+```
+
+# Output
+
+```js
+/* 0 */ import /* 1 */module /* 2 */from /* 3 */
+from; /* 4 */
+("./module.wasm") /* 5 */;
+```
+
+# Errors
+```
+comments.js:1:48 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected a string literal but instead found 'from'
+
+ > 1 │ /* 0 */import /* 1 */module /* 2 */from /* 3 */from /* 4 */"./module.wasm"/* 5 */;
+ │ ^^^^
+ 2 │
+
+ i Expected a string literal here
+
+ > 1 │ /* 0 */import /* 1 */module /* 2 */from /* 3 */from /* 4 */"./module.wasm"/* 5 */;
+ │ ^^^^
+ 2 │
+
+comments.js:1:60 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ /* 0 */import /* 1 */module /* 2 */from /* 3 */from /* 4 */"./module.wasm"/* 5 */;
+ │ ^^^^^^^^^^^^^^^
+ 2 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ /* 0 */import /* 1 */module /* 2 */from /* 3 */from /* 4 */"./module.wasm"/* 5 */;
+ │ ^^^^^^^^^^^^^^^
+ 2 │
+
+ i ...Which is required to end this statement
+
+ > 1 │ /* 0 */import /* 1 */module /* 2 */from /* 3 */from /* 4 */"./module.wasm"/* 5 */;
+ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ 2 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js
new file mode 100644
index 00000000000..0c84d385708
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js
@@ -0,0 +1 @@
+import module foo from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js.prettier-snap
new file mode 100644
index 00000000000..0c84d385708
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js.prettier-snap
@@ -0,0 +1 @@
+import module foo from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js.snap
new file mode 100644
index 00000000000..9a33311d925
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/import-reflection.js.snap
@@ -0,0 +1,91 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/import-reflection/import-reflection.js
+---
+
+# Input
+
+```js
+import module foo from "./module.wasm";
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1 +1,4 @@
+-import module foo from "./module.wasm";
++import module
++foo;
++from;
++("./module.wasm");
+```
+
+# Output
+
+```js
+import module
+foo;
+from;
+("./module.wasm");
+```
+
+# Errors
+```
+import-reflection.js:1:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × expected `from` but instead found `foo`
+
+ > 1 │ import module foo from "./module.wasm";
+ │ ^^^
+ 2 │
+
+ i Remove foo
+
+import-reflection.js:1:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ import module foo from "./module.wasm";
+ │ ^^^^
+ 2 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ import module foo from "./module.wasm";
+ │ ^^^^
+ 2 │
+
+ i ...Which is required to end this statement
+
+ > 1 │ import module foo from "./module.wasm";
+ │ ^^^^^^^^
+ 2 │
+
+import-reflection.js:1:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ × Expected a semicolon or an implicit semicolon after a statement, but found none
+
+ > 1 │ import module foo from "./module.wasm";
+ │ ^^^^^^^^^^^^^^^
+ 2 │
+
+ i An explicit or implicit semicolon is expected here...
+
+ > 1 │ import module foo from "./module.wasm";
+ │ ^^^^^^^^^^^^^^^
+ 2 │
+
+ i ...Which is required to end this statement
+
+ > 1 │ import module foo from "./module.wasm";
+ │ ^^^^^^^^^^^^^^^^^^^^
+ 2 │
+
+
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-default-import.mjs b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-default-import.mjs
new file mode 100644
index 00000000000..b0f11212d09
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-default-import.mjs
@@ -0,0 +1,2 @@
+import module foo from "./module.wasm";
+import bar from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-default-import.mjs.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-default-import.mjs.prettier-snap
new file mode 100644
index 00000000000..b0f11212d09
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-default-import.mjs.prettier-snap
@@ -0,0 +1,2 @@
+import module foo from "./module.wasm";
+import bar from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding-escaped.mjs b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding-escaped.mjs
new file mode 100644
index 00000000000..6185d417527
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding-escaped.mjs
@@ -0,0 +1 @@
+import module \u0066rom from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding-escaped.mjs.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding-escaped.mjs.prettier-snap
new file mode 100644
index 00000000000..bac2eb72208
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding-escaped.mjs.prettier-snap
@@ -0,0 +1 @@
+import module from from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding.mjs b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding.mjs
new file mode 100644
index 00000000000..bac2eb72208
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding.mjs
@@ -0,0 +1 @@
+import module from from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding.mjs.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding.mjs.prettier-snap
new file mode 100644
index 00000000000..bac2eb72208
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-from-as-default-module-binding.mjs.prettier-snap
@@ -0,0 +1 @@
+import module from from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding-2.mjs b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding-2.mjs
new file mode 100644
index 00000000000..f3d7cb5f987
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding-2.mjs
@@ -0,0 +1 @@
+import module, { createRequire } from "node:module";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding-2.mjs.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding-2.mjs.prettier-snap
new file mode 100644
index 00000000000..f3d7cb5f987
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding-2.mjs.prettier-snap
@@ -0,0 +1 @@
+import module, { createRequire } from "node:module";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding.mjs b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding.mjs
new file mode 100644
index 00000000000..bd14dd36b0c
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding.mjs
@@ -0,0 +1 @@
+import module from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding.mjs.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding.mjs.prettier-snap
new file mode 100644
index 00000000000..bd14dd36b0c
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/import-reflection/valid-module-as-default-binding.mjs.prettier-snap
@@ -0,0 +1 @@
+import module from "./module.wasm";
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js b/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js
new file mode 100644
index 00000000000..a8ba2c14905
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js
@@ -0,0 +1,8 @@
+foo(/* HTML */ ` bar `);
+foo(/* HTML */ ` bar `);
+foo(/* HTML */ `
bar
foo
`);
+foo(/* HTML */ `
bar
foo
`);
+foo(/* GraphQL */ `query { foo { bar } }`);
+foo(/* ... */ css`color:magenta`);
+const a = b => /* HTML */ ` bar `
+const c = b => /* HTML */ ` bar `
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js.prettier-snap
new file mode 100644
index 00000000000..a4d6495e2fd
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js.prettier-snap
@@ -0,0 +1,36 @@
+foo(/* HTML */ `
+ bar
+ `);
+foo(/* HTML */ `
+
+ bar
+
+`);
+foo(/* HTML */ `
+
bar
+ foo
+
`);
+foo(/* HTML */ `
+
+
bar
+ foo
+
+`);
+foo(/* GraphQL */ `
+ query {
+ foo {
+ bar
+ }
+ }
+`);
+foo(/* ... */ css`
+ color: magenta;
+`);
+const a = (b) => /* HTML */ `
+ bar
+ `;
+const c = (b) => /* HTML */ `
+
+ bar
+
+`;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js.snap b/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js.snap
new file mode 100644
index 00000000000..b2cfee132da
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/js/last-argument-expansion/embed.js.snap
@@ -0,0 +1,86 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: js/last-argument-expansion/embed.js
+---
+
+# Input
+
+```js
+foo(/* HTML */ ` bar `);
+foo(/* HTML */ ` bar `);
+foo(/* HTML */ `
bar
foo
`);
+foo(/* HTML */ `
bar
foo
`);
+foo(/* GraphQL */ `query { foo { bar } }`);
+foo(/* ... */ css`color:magenta`);
+const a = b => /* HTML */ ` bar `
+const c = b => /* HTML */ ` bar `
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -1,36 +1,8 @@
+-foo(/* HTML */ `
+- bar
+- `);
+-foo(/* HTML */ `
+-
+- bar
+-
+-`);
+-foo(/* HTML */ `
+-
bar
+- foo
+-
`);
+-foo(/* HTML */ `
+-
+-
bar
+- foo
+-
+-`);
+-foo(/* GraphQL */ `
+- query {
+- foo {
+- bar
+- }
+- }
+-`);
+-foo(/* ... */ css`
+- color: magenta;
+-`);
+-const a = (b) => /* HTML */ `
+- bar
+- `;
+-const c = (b) => /* HTML */ `
+-
+- bar
+-
+-`;
++foo(/* HTML */ ` bar `);
++foo(/* HTML */ ` bar `);
++foo(/* HTML */ `
bar
foo
`);
++foo(/* HTML */ `
bar
foo
`);
++foo(/* GraphQL */ `query { foo { bar } }`);
++foo(/* ... */ css`color:magenta`);
++const a = (b) => /* HTML */ ` bar `;
++const c = (b) => /* HTML */ ` bar `;
+```
+
+# Output
+
+```js
+foo(/* HTML */ ` bar `);
+foo(/* HTML */ ` bar `);
+foo(/* HTML */ `
Long long long long long, very very long text. And more text. Another text.
;
+() => () =>
Long long long long long, very very long text. And more text. Another text.
;
+() => () => () =>
Long long long long long, very very long text. And more text. Another text.
;
+
+
+ {We => 'The purple monkey danced with a tambourine made of cheese.' + 'The robot chef cooked a cake that tasted like rainbows.' + 'The talking pineapple sang a lullaby to the sleepy giraffe.'}
+;
+
+ {We => love => 'The purple monkey danced with a tambourine made of cheese.' + 'The robot chef cooked a cake that tasted like rainbows.' + 'The talking pineapple sang a lullaby to the sleepy giraffe.'}
+;
+
+ {We => love => currying => 'The purple monkey danced with a tambourine made of cheese.' + 'The robot chef cooked a cake that tasted like rainbows.' + 'The talking pineapple sang a lullaby to the sleepy giraffe.'}
+;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/arrow.js.prettier-snap b/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/arrow.js.prettier-snap
new file mode 100644
index 00000000000..e75ed54a8ef
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/arrow.js.prettier-snap
@@ -0,0 +1,57 @@
+() => (
+
+
+
+);
+() => () => (
+
+
+
+);
+() => () => () => (
+
+
+
+);
+
+() =>
Some text here
;
+() => () =>
Some text here
;
+() => () => () =>
Some text here
;
+
+() => (
+
+ Long long long long long, very very long text. And more text. Another text.
+
+);
+() => () => (
+
+ Long long long long long, very very long text. And more text. Another text.
+
+);
+() => () => () => (
+
+ Long long long long long, very very long text. And more text. Another text.
+
+);
+
+
+ {(We) =>
+ "The purple monkey danced with a tambourine made of cheese." +
+ "The robot chef cooked a cake that tasted like rainbows." +
+ "The talking pineapple sang a lullaby to the sleepy giraffe."
+ }
+;
+
+ {(We) => (love) =>
+ "The purple monkey danced with a tambourine made of cheese." +
+ "The robot chef cooked a cake that tasted like rainbows." +
+ "The talking pineapple sang a lullaby to the sleepy giraffe."
+ }
+;
+
+ {(We) => (love) => (currying) =>
+ "The purple monkey danced with a tambourine made of cheese." +
+ "The robot chef cooked a cake that tasted like rainbows." +
+ "The talking pineapple sang a lullaby to the sleepy giraffe."
+ }
+;
diff --git a/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/arrow.js.snap b/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/arrow.js.snap
new file mode 100644
index 00000000000..b58f10ba0b9
--- /dev/null
+++ b/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/arrow.js.snap
@@ -0,0 +1,183 @@
+---
+source: crates/rome_formatter_test/src/snapshot_builder.rs
+info: jsx/jsx/arrow.js
+---
+
+# Input
+
+```js
+() => ;
+() => () => ;
+() => () => () => ;
+
+() =>
Some text here
;
+() => () =>
Some text here
;
+() => () => () =>
Some text here
;
+
+() =>
Long long long long long, very very long text. And more text. Another text.
;
+() => () =>
Long long long long long, very very long text. And more text. Another text.
;
+() => () => () =>
Long long long long long, very very long text. And more text. Another text.
;
+
+
+ {We => 'The purple monkey danced with a tambourine made of cheese.' + 'The robot chef cooked a cake that tasted like rainbows.' + 'The talking pineapple sang a lullaby to the sleepy giraffe.'}
+;
+
+ {We => love => 'The purple monkey danced with a tambourine made of cheese.' + 'The robot chef cooked a cake that tasted like rainbows.' + 'The talking pineapple sang a lullaby to the sleepy giraffe.'}
+;
+
+ {We => love => currying => 'The purple monkey danced with a tambourine made of cheese.' + 'The robot chef cooked a cake that tasted like rainbows.' + 'The talking pineapple sang a lullaby to the sleepy giraffe.'}
+;
+
+```
+
+
+# Prettier differences
+
+```diff
+--- Prettier
++++ Rome
+@@ -3,16 +3,18 @@
+
+
+ );
+-() => () => (
+-
+-
+-
+-);
+-() => () => () => (
+-
+-
+-
+-);
++() => () =>
++ (
++
++
++
++ );
++() => () => () =>
++ (
++
++
++
++ );
+
+ () =>
Some text here
;
+ () => () =>
Some text here
;
+@@ -23,16 +25,20 @@
+ Long long long long long, very very long text. And more text. Another text.
+
+ );
+-() => () => (
+-
+- Long long long long long, very very long text. And more text. Another text.
+-
+-);
+-() => () => () => (
+-
+- Long long long long long, very very long text. And more text. Another text.
+-
+-);
++() => () =>
++ (
++
++ Long long long long long, very very long text. And more text. Another
++ text.
++
++ );
++() => () => () =>
++ (
++
++ Long long long long long, very very long text. And more text. Another
++ text.
++
++ );
+
+
+ {(We) =>
+@@ -45,13 +51,11 @@
+ {(We) => (love) =>
+ "The purple monkey danced with a tambourine made of cheese." +
+ "The robot chef cooked a cake that tasted like rainbows." +
+- "The talking pineapple sang a lullaby to the sleepy giraffe."
+- }
++ "The talking pineapple sang a lullaby to the sleepy giraffe."}
+ ;
+
+ {(We) => (love) => (currying) =>
+ "The purple monkey danced with a tambourine made of cheese." +
+ "The robot chef cooked a cake that tasted like rainbows." +
+- "The talking pineapple sang a lullaby to the sleepy giraffe."
+- }
++ "The talking pineapple sang a lullaby to the sleepy giraffe."}
+ ;
+```
+
+# Output
+
+```js
+() => (
+
+
+
+);
+() => () =>
+ (
+
+
+
+ );
+() => () => () =>
+ (
+
+
+
+ );
+
+() =>
Some text here
;
+() => () =>
Some text here
;
+() => () => () =>
Some text here
;
+
+() => (
+
+ Long long long long long, very very long text. And more text. Another text.
+
+);
+() => () =>
+ (
+
+ Long long long long long, very very long text. And more text. Another
+ text.
+
+ );
+() => () => () =>
+ (
+
+ Long long long long long, very very long text. And more text. Another
+ text.
+
+ );
+
+
+ {(We) =>
+ "The purple monkey danced with a tambourine made of cheese." +
+ "The robot chef cooked a cake that tasted like rainbows." +
+ "The talking pineapple sang a lullaby to the sleepy giraffe."
+ }
+;
+
+ {(We) => (love) =>
+ "The purple monkey danced with a tambourine made of cheese." +
+ "The robot chef cooked a cake that tasted like rainbows." +
+ "The talking pineapple sang a lullaby to the sleepy giraffe."}
+;
+
+ {(We) => (love) => (currying) =>
+ "The purple monkey danced with a tambourine made of cheese." +
+ "The robot chef cooked a cake that tasted like rainbows." +
+ "The talking pineapple sang a lullaby to the sleepy giraffe."}
+;
+```
+
+
diff --git a/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/expression.js b/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/expression.js
index 0232f42fd99..55ef3acafb0 100644
--- a/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/expression.js
+++ b/crates/rome_js_formatter/tests/specs/prettier/jsx/jsx/expression.js
@@ -82,17 +82,6 @@
}}
/>;
-,
- ) => {
- this.setState({
- updatedTask: this.state.updatedTask.set(key, value)
- });
- }}
-/>;
-
{data => doLogClick("short", "short", data)}
;
@@ -109,17 +98,6 @@
}}
;
-
- {(
- key: "possible_key_1" | "possible_key_2" | "possible_key_3",
- value: string | Immutable.List,
- ) => {
- this.setState({
- updatedTask: this.state.updatedTask.set(key, value)
- });
- }}
-;
-