Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
chore: update prettier v3 (#4740)
Browse files Browse the repository at this point in the history
* chore: update prettier

* update snapshot

* fix build error

* update pnpm to v8
  • Loading branch information
nissy-dev committed Jul 30, 2023
1 parent 52191e5 commit 354cc78
Show file tree
Hide file tree
Showing 482 changed files with 15,020 additions and 3,010 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
${{ runner.os }}-
- uses: pnpm/action-setup@v2.2.4
with:
version: 7
version: 8
- name: Install toolchain
uses: moonrepo/setup-rust@v0
- name: Build WASM module for the web
Expand Down
7 changes: 2 additions & 5 deletions crates/rome_formatter_test/src/prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
"start": "node prepare_tests"
},
"dependencies": {
"prettier": "2.8.8"
},
"devDependencies": {
"@types/prettier": "^2.7.1"
"prettier": "3.0.0"
},
"engines": {
"pnpm": "^7.0.0"
"pnpm": "^8.0.0"
}
}
25 changes: 10 additions & 15 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.

4 changes: 2 additions & 2 deletions crates/rome_formatter_test/src/prettier/prepare_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function traverseDir(dir, input_config) {
try {
// We need to reformat prettier snapshot
// because Rome and Prettier have different default options
snapshotContent = prettier.format(snapshotContent, config);
snapshotContent = await prettier.format(snapshotContent, config);
} catch (error) {
console.error(`Prettier format error in ${filePath}: ${error}`);
}
Expand All @@ -99,7 +99,7 @@ async function traverseDir(dir, input_config) {

try {
// Try to format input with prettier
const prettierOutput = prettier.format(content, config);
const prettierOutput = await prettier.format(content, config);

const outDir = path.resolve(outPath, '..');
await fs.mkdir(outDir, { recursive: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,84 @@ a = [


]

b = [
100,

(200)
,

300
,

1
,
2, 3
]

c = [
"apple",
"banana",
"blueberry",

"red",
"blue"
,
"yellow",

"broccoli",
"celery",
"lettuce"
,

"green"
,
"green",
"green",

//an egg
"egg",
//a bigger egg
"big egg"
//the biggest egg
,
"huge egg"
,

//not an egg
"lasagna"

]

_ = [
a,

b //
]

_ = [
(a),

b, //
];

_ = [
(((((
a = b/* comment */))/* comment */))),

c //
]

_ = [
(((((
(a = b)/* comment */))/* comment */))),

c //
]

_ = [
(a=b

),
b, //
];
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,70 @@ a = [

4,
];

b = [
100,

200,

300,

1, 2, 3,
];

c = [
"apple",
"banana",
"blueberry",

"red",
"blue",
"yellow",

"broccoli",
"celery",
"lettuce",

"green",
"green",
"green",

//an egg
"egg",
//a bigger egg
"big egg",
//the biggest egg
"huge egg",

//not an egg
"lasagna",
];

_ = [
a,

b, //
];

_ = [
a,

b, //
];

_ = [
(a = b) /* comment */ /* comment */,

c, //
];

_ = [
(a = b) /* comment */ /* comment */,

c, //
];

_ = [
(a = b),
b, //
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
a = [
[1,2],
[1,2],
]

a = [
#[1,2],
#[1,2],
]

a = [
{a, b},
{a, b},
]

a = [
#{a, b},
#{a, b},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
a = [
[1, 2],
[1, 2],
];

a = [
#[1, 2],
#[1, 2],
];

a = [
{ a, b },
{ a, b },
];

a = [
#{ a, b },
#{ a, b },
];

0 comments on commit 354cc78

Please sign in to comment.