+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/rome_formatter_test/src/prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"start": "node prepare_tests"
},
"dependencies": {
"prettier": "^2.7.1"
"prettier": "2.8.1"
},
"devDependencies": {
"@types/prettier": "^2.7.1"
Expand Down
8 changes: 4 additions & 4 deletions crates/rome_formatter_test/src/prettier/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
}
}
{
for (const srcPath of [
123, 123_123_123, 123_123_123_1, 13_123_3123_31_432,
]) {
for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_432]) {
}
}
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
source: crates/rome_formatter_test/src/snapshot_builder.rs
info: js/arrays/issue-10159.js
---

# Input

```js
{for (const srcPath of [src, `${src}.js`, `${src}/index`, `${src}/index.js`]) {}}
{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_43]) {}}
{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_432]) {}}
{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_4321]) {}}

```


# Prettier differences

```diff
--- Prettier
+++ Rome
@@ -7,7 +7,9 @@
}
}
{
- for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_432]) {
+ for (const srcPath of [
+ 123, 123_123_123, 123_123_123_1, 13_123_3123_31_432,
+ ]) {
}
}
{
```

# Output

```js
{
for (const srcPath of [src, `${src}.js`, `${src}/index`, `${src}/index.js`]) {
}
}
{
for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_43]) {
}
}
{
for (const srcPath of [
123, 123_123_123, 123_123_123_1, 13_123_3123_31_432,
]) {
}
}
{
for (const srcPath of [
123, 123_123_123, 123_123_123_1, 13_123_3123_31_4321,
]) {
}
}
```


Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
async;
foo() {};
}

class B {
async = 1;
foo() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
async;
foo() {}
}

class B {
async = 1;
foo() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
source: crates/rome_formatter_test/src/snapshot_builder.rs
info: js/classes/keyword-property/async.js
---

# Input

```js
class A {
async;
foo() {};
}

class B {
async = 1;
foo() {}
}

```


# Prettier differences

```diff
--- Prettier
+++ Rome
@@ -1,9 +1,10 @@
class A {
- async;
+ async
foo() {}
}

class B {
- async = 1;
+ async
+ = 1
foo() {}
}
```

# Output

```js
class A {
async
foo() {}
}

class B {
async
= 1
foo() {}
}
```

# Errors
```
async.js:2:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× expected an identifier, a string literal, a number literal, a private field name, or a computed name but instead found ';'

1 │ class A {
> 2 │ async;
│ ^
3 │ foo() {};
4 │ }

i Expected an identifier, a string literal, a number literal, a private field name, or a computed name here

1 │ class A {
> 2 │ async;
│ ^
3 │ foo() {};
4 │ }

async.js:7:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× expected an identifier, a string literal, a number literal, a private field name, or a computed name but instead found '='

6 │ class B {
> 7 │ async = 1;
│ ^
8 │ foo() {}
9 │ }

i Expected an identifier, a string literal, a number literal, a private field name, or a computed name here

6 │ class B {
> 7 │ async = 1;
│ ^
8 │ foo() {}
9 │ }


```


Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
get;
foo() {}
}

class B {
get = 1;
foo() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
get;
foo() {}
}

class B {
get = 1;
foo() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
set;
foo(v) {}
}

class B {
set = 1;
foo(v) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
set;
foo(v) {}
}

class B {
set = 1;
foo(v) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
static async;
foo() {}
}

class B {
static async = 1;
foo() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
static async;
foo() {}
}

class B {
static async = 1;
foo() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
source: crates/rome_formatter_test/src/snapshot_builder.rs
info: js/classes/keyword-property/static-async.js
---

# Input

```js
class A {
static async;
foo() {}
}

class B {
static async = 1;
foo() {}
}

```


# Prettier differences

```diff
--- Prettier
+++ Rome
@@ -1,9 +1,10 @@
class A {
- static async;
+ static async
foo() {}
}

class B {
- static async = 1;
+ static async
+ = 1
foo() {}
}
```

# Output

```js
class A {
static async
foo() {}
}

class B {
static async
= 1
foo() {}
}
```

# Errors
```
static-async.js:2:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× expected an identifier, a string literal, a number literal, a private field name, or a computed name but instead found ';'

1 │ class A {
> 2 │ static async;
│ ^
3 │ foo() {}
4 │ }

i Expected an identifier, a string literal, a number literal, a private field name, or a computed name here

1 │ class A {
> 2 │ static async;
│ ^
3 │ foo() {}
4 │ }

static-async.js:7:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× expected an identifier, a string literal, a number literal, a private field name, or a computed name but instead found '='

6 │ class B {
> 7 │ static async = 1;
│ ^
8 │ foo() {}
9 │ }

i Expected an identifier, a string literal, a number literal, a private field name, or a computed name here

6 │ class B {
> 7 │ static async = 1;
│ ^
8 │ foo() {}
9 │ }


```


Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class A {
static get;
foo() {}
}

class B {
static get = 1;
foo() {}
}
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载