diff --git a/crates/biome_formatter_test/src/prettier/package.json b/crates/biome_formatter_test/src/prettier/package.json index 5a5ce45f2c5b..a5c62864eee3 100644 --- a/crates/biome_formatter_test/src/prettier/package.json +++ b/crates/biome_formatter_test/src/prettier/package.json @@ -4,7 +4,7 @@ "start": "node prepare_tests" }, "dependencies": { - "prettier": "3.0.0" + "prettier": "3.1.0" }, "engines": { "pnpm": "^8.0.0" diff --git a/crates/biome_formatter_test/src/prettier/pnpm-lock.yaml b/crates/biome_formatter_test/src/prettier/pnpm-lock.yaml deleted file mode 100644 index 89579a0aca1b..000000000000 --- a/crates/biome_formatter_test/src/prettier/pnpm-lock.yaml +++ /dev/null @@ -1,18 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -dependencies: - prettier: - specifier: 3.0.0 - version: 3.0.0 - -packages: - - /prettier@3.0.0: - resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==} - engines: {node: '>=14'} - hasBin: true - dev: false diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/assignment/issue-15534.js b/crates/biome_js_formatter/tests/specs/prettier/js/assignment/issue-15534.js new file mode 100644 index 000000000000..f93b90a4db7a --- /dev/null +++ b/crates/biome_js_formatter/tests/specs/prettier/js/assignment/issue-15534.js @@ -0,0 +1,7 @@ +params["redirectTo"] = `${window.location.pathname}${window.location.search}${window.location.hash}`; + +params["redirectTo"]["codePointAt"]["name"] = + `${window.location.pathname}${window.location.search}${window.location.hash}`; + +params.redirectTo.bar.bar.ba.barab["foo"].abr = + `${window.location.pathname}${window.location.search}${window.location.hash}`; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/assignment/issue-15534.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/assignment/issue-15534.js.prettier-snap new file mode 100644 index 000000000000..1195248356b4 --- /dev/null +++ b/crates/biome_js_formatter/tests/specs/prettier/js/assignment/issue-15534.js.prettier-snap @@ -0,0 +1,11 @@ +params[ + "redirectTo" +] = `${window.location.pathname}${window.location.search}${window.location.hash}`; + +params["redirectTo"]["codePointAt"][ + "name" +] = `${window.location.pathname}${window.location.search}${window.location.hash}`; + +params.redirectTo.bar.bar.ba.barab[ + "foo" +].abr = `${window.location.pathname}${window.location.search}${window.location.hash}`; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/flow.js b/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/flow.js deleted file mode 100644 index 44c0e33053d3..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/flow.js +++ /dev/null @@ -1,3 +0,0 @@ -// https://babeljs.io/docs/en/babel-preset-flow - -function foo(one: any, two: number, three?): string {} diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/flow.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/flow.js.prettier-snap deleted file mode 100644 index 44c0e33053d3..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/flow.js.prettier-snap +++ /dev/null @@ -1,3 +0,0 @@ -// https://babeljs.io/docs/en/babel-preset-flow - -function foo(one: any, two: number, three?): string {} diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/typescript.js b/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/typescript.js deleted file mode 100644 index 7fe7124f31e7..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/typescript.js +++ /dev/null @@ -1,3 +0,0 @@ -// https://babeljs.io/docs/en/babel-preset-typescript - -const x: number = 0; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/typescript.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/typescript.js.prettier-snap deleted file mode 100644 index 7fe7124f31e7..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/babel-plugins/typescript.js.prettier-snap +++ /dev/null @@ -1,3 +0,0 @@ -// https://babeljs.io/docs/en/babel-preset-typescript - -const x: number = 0; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/comments/function/between-parentheses-and-function-body.js b/crates/biome_js_formatter/tests/specs/prettier/js/comments/function/between-parentheses-and-function-body.js index 47163e542422..b5c47f27f542 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/js/comments/function/between-parentheses-and-function-body.js +++ b/crates/biome_js_formatter/tests/specs/prettier/js/comments/function/between-parentheses-and-function-body.js @@ -12,6 +12,7 @@ function function_declaration() // return 42 // })(); + // FIXME // TODO: reformat issue // (function () @@ -34,7 +35,7 @@ a = { // this is a function {}, - // bar: function() - // // this is a function - // {}, +// bar: function() +// // this is a function +// {}, } diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/comments/function/between-parentheses-and-function-body.js.snap b/crates/biome_js_formatter/tests/specs/prettier/js/comments/function/between-parentheses-and-function-body.js.snap index 1adf996f8650..a09cbbd0c72a 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/js/comments/function/between-parentheses-and-function-body.js.snap +++ b/crates/biome_js_formatter/tests/specs/prettier/js/comments/function/between-parentheses-and-function-body.js.snap @@ -20,6 +20,7 @@ function function_declaration() // return 42 // })(); + // FIXME // TODO: reformat issue // (function () @@ -42,9 +43,9 @@ a = { // this is a function {}, - // bar: function() - // // this is a function - // {}, +// bar: function() +// // this is a function +// {}, } ``` diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/comments/issue-7724.js b/crates/biome_js_formatter/tests/specs/prettier/js/comments/issue-7724.js deleted file mode 100644 index 50b7c53c97a0..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/comments/issue-7724.js +++ /dev/null @@ -1,18 +0,0 @@ -const foo = "Bar"; - -/** - * @template T - * @param {Type} type - * @param {T} value - * @return {Value} - *//** - * @param {Type} type - * @return {Value} - */ -function value(type, value) { - if (arguments.length === 2) { - return new ConcreteValue(type, value); - } else { - return new Value(type); - } -} \ No newline at end of file diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/comments/issue-7724.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/comments/issue-7724.js.prettier-snap deleted file mode 100644 index 123fc47ac8e9..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/comments/issue-7724.js.prettier-snap +++ /dev/null @@ -1,18 +0,0 @@ -const foo = "Bar"; - -/** - * @template T - * @param {Type} type - * @param {T} value - * @return {Value} - */ /** - * @param {Type} type - * @return {Value} - */ -function value(type, value) { - if (arguments.length === 2) { - return new ConcreteValue(type, value); - } else { - return new Value(type); - } -} diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/comments/return-statement.js b/crates/biome_js_formatter/tests/specs/prettier/js/comments/return-statement.js index 29ac5e49a9c6..6963235ca170 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/js/comments/return-statement.js +++ b/crates/biome_js_formatter/tests/specs/prettier/js/comments/return-statement.js @@ -133,7 +133,7 @@ function multilineBlockNextLine() { return ( /** * @type {string} - */ + */ 'result' ) } @@ -163,7 +163,7 @@ function singleLineBlockSameLine() { function singleLineBlockNextLine() { return ( - /** Result below */ + /** Result below */ 'result' ) } diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/comments/return-statement.js.snap b/crates/biome_js_formatter/tests/specs/prettier/js/comments/return-statement.js.snap index 4a882d29dc3a..9998b09d67fd 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/js/comments/return-statement.js.snap +++ b/crates/biome_js_formatter/tests/specs/prettier/js/comments/return-statement.js.snap @@ -141,7 +141,7 @@ function multilineBlockNextLine() { return ( /** * @type {string} - */ + */ 'result' ) } @@ -171,7 +171,7 @@ function singleLineBlockSameLine() { function singleLineBlockNextLine() { return ( - /** Result below */ + /** Result below */ 'result' ) } diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js b/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js deleted file mode 100644 index f28b803b77ec..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js +++ /dev/null @@ -1,5 +0,0 @@ -class Something { - @Annotateme() - // comment - static property: Array; -} diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js.prettier-snap deleted file mode 100644 index c298cb06e265..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js.prettier-snap +++ /dev/null @@ -1,5 +0,0 @@ -class Something { - @Annotateme() - // comment - static property: Array; -} diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js.snap b/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js.snap deleted file mode 100644 index 5732b99c9d87..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/decorator-comments/comments.js.snap +++ /dev/null @@ -1,61 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: js/decorator-comments/comments.js ---- - -# Input - -```js -class Something { - @Annotateme() - // comment - static property: Array; -} - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -1,5 +1,5 @@ - class Something { - @Annotateme() -- // comment -- static property: Array; -+ // comment -+ static property: Array; - } -``` - -# Output - -```js -class Something { - @Annotateme() - // comment - static property: Array; -} -``` - -# Errors -``` -comments.js:4:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × return types can only be used in TypeScript files - - 2 │ @Annotateme() - 3 │ // comment - > 4 │ static property: Array; - │ ^^^^^^^^^^^^^^^ - 5 │ } - 6 │ - - i remove this type annotation - - -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js b/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js deleted file mode 100644 index 2626fe4adb41..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js +++ /dev/null @@ -1,8 +0,0 @@ -export * as ns from 'mod'; -export v from 'mod'; -export a, * as b from 'mod'; -export c, { foo } from 'mod'; -export * as d, { bar } from 'mod'; -export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; -export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; -export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js.prettier-snap deleted file mode 100644 index 50430c0cdb08..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js.prettier-snap +++ /dev/null @@ -1,13 +0,0 @@ -export * as ns from "mod"; -export v from "mod"; -export a, * as b from "mod"; -export c, { foo } from "mod"; -export * as d, { bar } from "mod"; -export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; -export Bar, { - barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr, -} from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; -export { - foooooooooooooooooooooooooooooooooooooooooooooo, - fooooooooooooooooooooooooooooooooooooooooooooooo, -} from "fooooooooooooooooooooooooooooo"; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js.snap b/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js.snap deleted file mode 100644 index 03887119f1af..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/export-extension/export.js.snap +++ /dev/null @@ -1,492 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: js/export-extension/export.js ---- - -# Input - -```js -export * as ns from 'mod'; -export v from 'mod'; -export a, * as b from 'mod'; -export c, { foo } from 'mod'; -export * as d, { bar } from 'mod'; -export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; -export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; -export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -1,12 +1,29 @@ - export * as ns from "mod"; --export v from "mod"; --export a, * as b from "mod"; --export c, { foo } from "mod"; --export * as d, { bar } from "mod"; -+export -+v; -+from; -+("mod"); -+export -+a, * as -+b; -+from; -+("mod"); -+export -+c, { foo }; -+from; -+("mod"); -+export * as d -+, -+{ -+ bar; -+} -+from; -+("mod"); - export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; --export Bar, { -- barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr, --} from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; -+export -+Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr }; -+from; -+("barrrrrrrrrrrrrrrrrrrrrrrrrrrr"); - export { - foooooooooooooooooooooooooooooooooooooooooooooo, - fooooooooooooooooooooooooooooooooooooooooooooooo, -``` - -# Output - -```js -export * as ns from "mod"; -export -v; -from; -("mod"); -export -a, * as -b; -from; -("mod"); -export -c, { foo }; -from; -("mod"); -export * as d -, -{ - bar; -} -from; -("mod"); -export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; -export -Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr }; -from; -("barrrrrrrrrrrrrrrrrrrrrrrrrrrr"); -export { - foooooooooooooooooooooooooooooooooooooooooooooo, - fooooooooooooooooooooooooooooooooooooooooooooooo, -} from "fooooooooooooooooooooooooooooo"; -``` - -# Errors -``` -export.js:2:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `*` but instead found `v` - - 1 │ export * as ns from 'mod'; - > 2 │ export v from 'mod'; - │ ^ - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - - i Remove v - -export.js:2:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 1 │ export * as ns from 'mod'; - > 2 │ export v from 'mod'; - │ ^^^^ - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - - i An explicit or implicit semicolon is expected here... - - 1 │ export * as ns from 'mod'; - > 2 │ export v from 'mod'; - │ ^^^^ - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - - i ...Which is required to end this statement - - 1 │ export * as ns from 'mod'; - > 2 │ export v from 'mod'; - │ ^^^^^^ - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - -export.js:2:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 1 │ export * as ns from 'mod'; - > 2 │ export v from 'mod'; - │ ^^^^^ - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - - i An explicit or implicit semicolon is expected here... - - 1 │ export * as ns from 'mod'; - > 2 │ export v from 'mod'; - │ ^^^^^ - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - - i ...Which is required to end this statement - - 1 │ export * as ns from 'mod'; - > 2 │ export v from 'mod'; - │ ^^^^^^^^^^ - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - -export.js:3:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a class, a function, or a variable declaration but instead found 'a'. - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - - i Expected a class, a function, or a variable declaration here. - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - -export.js:3:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected an expression for the left hand side of the `*` operator. - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - - i This operator requires a left hand side value - -export.js:3:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - - i An explicit or implicit semicolon is expected here... - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - - i ...Which is required to end this statement - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^^^^^^^^^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - -export.js:3:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^^^^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - - i An explicit or implicit semicolon is expected here... - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^^^^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - - i ...Which is required to end this statement - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^^^^^^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - -export.js:3:23 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^^^^^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - - i An explicit or implicit semicolon is expected here... - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^^^^^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - - i ...Which is required to end this statement - - 1 │ export * as ns from 'mod'; - 2 │ export v from 'mod'; - > 3 │ export a, * as b from 'mod'; - │ ^^^^^^^^^^ - 4 │ export c, { foo } from 'mod'; - 5 │ export * as d, { bar } from 'mod'; - -export.js:4:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a class, a function, or a variable declaration but instead found 'c'. - - 2 │ export v from 'mod'; - 3 │ export a, * as b from 'mod'; - > 4 │ export c, { foo } from 'mod'; - │ ^ - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - - i Expected a class, a function, or a variable declaration here. - - 2 │ export v from 'mod'; - 3 │ export a, * as b from 'mod'; - > 4 │ export c, { foo } from 'mod'; - │ ^ - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - -export.js:4:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 2 │ export v from 'mod'; - 3 │ export a, * as b from 'mod'; - > 4 │ export c, { foo } from 'mod'; - │ ^^^^ - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - - i An explicit or implicit semicolon is expected here... - - 2 │ export v from 'mod'; - 3 │ export a, * as b from 'mod'; - > 4 │ export c, { foo } from 'mod'; - │ ^^^^ - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - - i ...Which is required to end this statement - - 2 │ export v from 'mod'; - 3 │ export a, * as b from 'mod'; - > 4 │ export c, { foo } from 'mod'; - │ ^^^^^^^^^^^^^^^ - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - -export.js:4:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 2 │ export v from 'mod'; - 3 │ export a, * as b from 'mod'; - > 4 │ export c, { foo } from 'mod'; - │ ^^^^^ - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - - i An explicit or implicit semicolon is expected here... - - 2 │ export v from 'mod'; - 3 │ export a, * as b from 'mod'; - > 4 │ export c, { foo } from 'mod'; - │ ^^^^^ - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - - i ...Which is required to end this statement - - 2 │ export v from 'mod'; - 3 │ export a, * as b from 'mod'; - > 4 │ export c, { foo } from 'mod'; - │ ^^^^^^^^^^ - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - -export.js:5:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `from` but instead found `,` - - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - > 5 │ export * as d, { bar } from 'mod'; - │ ^ - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - - i Remove , - -export.js:5:29 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - > 5 │ export * as d, { bar } from 'mod'; - │ ^^^^^ - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - - i An explicit or implicit semicolon is expected here... - - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - > 5 │ export * as d, { bar } from 'mod'; - │ ^^^^^ - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - - i ...Which is required to end this statement - - 3 │ export a, * as b from 'mod'; - 4 │ export c, { foo } from 'mod'; - > 5 │ export * as d, { bar } from 'mod'; - │ ^^^^^^^^^^ - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - -export.js:7:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a class, a function, or a variable declaration but instead found 'Bar'. - - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - > 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - │ ^^^ - 8 │ export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 9 │ - - i Expected a class, a function, or a variable declaration here. - - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - > 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - │ ^^^ - 8 │ export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 9 │ - -export.js:7:63 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - > 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - │ ^^^^ - 8 │ export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 9 │ - - i An explicit or implicit semicolon is expected here... - - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - > 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - │ ^^^^ - 8 │ export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 9 │ - - i ...Which is required to end this statement - - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - > 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - 8 │ export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 9 │ - -export.js:7:68 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - > 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - 8 │ export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 9 │ - - i An explicit or implicit semicolon is expected here... - - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - > 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - 8 │ export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 9 │ - - i ...Which is required to end this statement - - 5 │ export * as d, { bar } from 'mod'; - 6 │ export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - > 7 │ export Bar, { barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr } from "barrrrrrrrrrrrrrrrrrrrrrrrrrrr"; - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - 8 │ export { foooooooooooooooooooooooooooooooooooooooooooooo, fooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; - 9 │ - - -``` - -# Lines exceeding max width of 80 characters -``` - 22: export { fooooooooooooooooooooooooooooooooooooooooooooooooo } from "fooooooooooooooooooooooooooooo"; -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js b/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js deleted file mode 100644 index af917844eaf7..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js +++ /dev/null @@ -1,9 +0,0 @@ -export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - -export a,{b} from "./baz"; - -export * as ns from "mod"; - -export * as foo,{bar} from "./baz"; - -export { undefinedExport }; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js.prettier-snap deleted file mode 100644 index 6b2f92eb0a5f..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js.prettier-snap +++ /dev/null @@ -1,15 +0,0 @@ -export { - value1, - value2 as value2_renamed, - value3, - value4 as value4_renamed, - value5, -} from "exports"; - -export a, { b } from "./baz"; - -export * as ns from "mod"; - -export * as foo, { bar } from "./baz"; - -export { undefinedExport }; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js.snap b/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js.snap deleted file mode 100644 index 54a5d3f837e2..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/exports/test.js.snap +++ /dev/null @@ -1,205 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: js/exports/test.js ---- - -# Input - -```js -export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - -export a,{b} from "./baz"; - -export * as ns from "mod"; - -export * as foo,{bar} from "./baz"; - -export { undefinedExport }; - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -6,10 +6,19 @@ - value5, - } from "exports"; - --export a, { b } from "./baz"; -+export -+a, { b }; -+from; -+("./baz"); - - export * as ns from "mod"; - --export * as foo, { bar } from "./baz"; -+export * as foo -+, -+{ -+ bar; -+} -+from; -+("./baz"); - - export { undefinedExport }; -``` - -# Output - -```js -export { - value1, - value2 as value2_renamed, - value3, - value4 as value4_renamed, - value5, -} from "exports"; - -export -a, { b }; -from; -("./baz"); - -export * as ns from "mod"; - -export * as foo -, -{ - bar; -} -from; -("./baz"); - -export { undefinedExport }; -``` - -# Errors -``` -test.js:3:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a class, a function, or a variable declaration but instead found 'a'. - - 1 │ export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - 2 │ - > 3 │ export a,{b} from "./baz"; - │ ^ - 4 │ - 5 │ export * as ns from "mod"; - - i Expected a class, a function, or a variable declaration here. - - 1 │ export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - 2 │ - > 3 │ export a,{b} from "./baz"; - │ ^ - 4 │ - 5 │ export * as ns from "mod"; - -test.js:3:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 1 │ export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - 2 │ - > 3 │ export a,{b} from "./baz"; - │ ^^^^ - 4 │ - 5 │ export * as ns from "mod"; - - i An explicit or implicit semicolon is expected here... - - 1 │ export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - 2 │ - > 3 │ export a,{b} from "./baz"; - │ ^^^^ - 4 │ - 5 │ export * as ns from "mod"; - - i ...Which is required to end this statement - - 1 │ export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - 2 │ - > 3 │ export a,{b} from "./baz"; - │ ^^^^^^^^^^ - 4 │ - 5 │ export * as ns from "mod"; - -test.js:3:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 1 │ export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - 2 │ - > 3 │ export a,{b} from "./baz"; - │ ^^^^^^^ - 4 │ - 5 │ export * as ns from "mod"; - - i An explicit or implicit semicolon is expected here... - - 1 │ export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - 2 │ - > 3 │ export a,{b} from "./baz"; - │ ^^^^^^^ - 4 │ - 5 │ export * as ns from "mod"; - - i ...Which is required to end this statement - - 1 │ export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from "exports"; - 2 │ - > 3 │ export a,{b} from "./baz"; - │ ^^^^^^^^^^^^ - 4 │ - 5 │ export * as ns from "mod"; - -test.js:7:16 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `from` but instead found `,` - - 5 │ export * as ns from "mod"; - 6 │ - > 7 │ export * as foo,{bar} from "./baz"; - │ ^ - 8 │ - 9 │ export { undefinedExport }; - - i Remove , - -test.js:7:28 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - 5 │ export * as ns from "mod"; - 6 │ - > 7 │ export * as foo,{bar} from "./baz"; - │ ^^^^^^^ - 8 │ - 9 │ export { undefinedExport }; - - i An explicit or implicit semicolon is expected here... - - 5 │ export * as ns from "mod"; - 6 │ - > 7 │ export * as foo,{bar} from "./baz"; - │ ^^^^^^^ - 8 │ - 9 │ export { undefinedExport }; - - i ...Which is required to end this statement - - 5 │ export * as ns from "mod"; - 6 │ - > 7 │ export * as foo,{bar} from "./baz"; - │ ^^^^^^^^^^^^ - 8 │ - 9 │ export { undefinedExport }; - - -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/first-argument-expansion/test.js b/crates/biome_js_formatter/tests/specs/prettier/js/first-argument-expansion/test.js deleted file mode 100644 index 12e57d4987fc..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/first-argument-expansion/test.js +++ /dev/null @@ -1,113 +0,0 @@ -setTimeout(function() { - thing(); -}, 500); - -["a","b","c"].reduce(function(item, thing) { - return thing + " " + item; -}, "letters:") - -func(() => { - thing(); -}, identifier); - -func(function() { - thing(); -}, this.props.timeout * 1000); - -func((that) => { - thing(); -}, this.props.getTimeout()); - -func(() => { - thing(); -}, true); - -func(() => { - thing(); -}, null); - -func(() => { - thing(); -}, undefined); - -func(() => { - thing(); -}, /regex.*?/); - -func(() => { - thing(); -}, 1 ? 2 : 3); - -func(function() { - return thing() -}, 1 ? 2 : 3); - -func(() => { - thing(); -}, something() ? someOtherThing() : somethingElse(true, 0)); - - -func(() => { - thing(); -}, something(longArgumentName, anotherLongArgumentName) ? someOtherThing() : somethingElse(true, 0)); - - -func(() => { - thing(); -}, something(longArgumentName, anotherLongArgumentName, anotherLongArgumentName, anotherLongArgumentName) ? someOtherThing() : somethingElse(true, 0)); - -compose((a) => { - return a.thing; -}, b => b * b); - -somthing.reduce(function(item, thing) { - return thing.blah = item; -}, {}) - -somthing.reduce(function(item, thing) { - return thing.push(item); -}, []) - -reallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongMethod((f, g, h) => { - return f.pop(); -}, true); - -// Don't do the rest of these - -func(function() { - thing(); -}, true, false); - -func(() => { - thing(); -}, {yes: true, cats: 5}); - -compose((a) => { - return a.thing; -}, b => { - return b + ""; -}); - -compose((a) => { - return a.thing; -}, b => [1, 2, 3, 4, 5]); - -renderThing(a => -
Content. So much to say. Oh my. Are we done yet?
-,args); - -setTimeout( - // Something - function() { - thing(); - }, - 500 -); - -setTimeout(/* blip */ function() { - thing(); -}, 500); - -func((args) => { - execute(args); -}, result => result && console.log("success")) diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/first-argument-expansion/test.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/first-argument-expansion/test.js.prettier-snap deleted file mode 100644 index af78b8a73982..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/first-argument-expansion/test.js.prettier-snap +++ /dev/null @@ -1,161 +0,0 @@ -setTimeout(function () { - thing(); -}, 500); - -["a", "b", "c"].reduce(function (item, thing) { - return thing + " " + item; -}, "letters:"); - -func(() => { - thing(); -}, identifier); - -func(function () { - thing(); -}, this.props.timeout * 1000); - -func((that) => { - thing(); -}, this.props.getTimeout()); - -func(() => { - thing(); -}, true); - -func(() => { - thing(); -}, null); - -func(() => { - thing(); -}, undefined); - -func(() => { - thing(); -}, /regex.*?/); - -func( - () => { - thing(); - }, - 1 ? 2 : 3, -); - -func( - function () { - return thing(); - }, - 1 ? 2 : 3, -); - -func( - () => { - thing(); - }, - something() ? someOtherThing() : somethingElse(true, 0), -); - -func( - () => { - thing(); - }, - something(longArgumentName, anotherLongArgumentName) - ? someOtherThing() - : somethingElse(true, 0), -); - -func( - () => { - thing(); - }, - something( - longArgumentName, - anotherLongArgumentName, - anotherLongArgumentName, - anotherLongArgumentName, - ) - ? someOtherThing() - : somethingElse(true, 0), -); - -compose( - (a) => { - return a.thing; - }, - (b) => b * b, -); - -somthing.reduce(function (item, thing) { - return (thing.blah = item); -}, {}); - -somthing.reduce(function (item, thing) { - return thing.push(item); -}, []); - -reallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongMethod( - (f, g, h) => { - return f.pop(); - }, - true, -); - -// Don't do the rest of these - -func( - function () { - thing(); - }, - true, - false, -); - -func( - () => { - thing(); - }, - { yes: true, cats: 5 }, -); - -compose( - (a) => { - return a.thing; - }, - (b) => { - return b + ""; - }, -); - -compose( - (a) => { - return a.thing; - }, - (b) => [1, 2, 3, 4, 5], -); - -renderThing( - (a) =>
Content. So much to say. Oh my. Are we done yet?
, - args, -); - -setTimeout( - // Something - function () { - thing(); - }, - 500, -); - -setTimeout( - /* blip */ function () { - thing(); - }, - 500, -); - -func( - (args) => { - execute(args); - }, - (result) => result && console.log("success"), -); diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/sequence-expression/parenthesized.js b/crates/biome_js_formatter/tests/specs/prettier/js/sequence-expression/parenthesized.js index 05fc4efe43e8..fefe644e19de 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/js/sequence-expression/parenthesized.js +++ b/crates/biome_js_formatter/tests/specs/prettier/js/sequence-expression/parenthesized.js @@ -20,4 +20,4 @@ // /* 9 */ // ) // /* 10 */ -// ); +// ); \ No newline at end of file diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/sequence-expression/parenthesized.js.snap b/crates/biome_js_formatter/tests/specs/prettier/js/sequence-expression/parenthesized.js.snap index f2083478fa31..d6639c54c6c1 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/js/sequence-expression/parenthesized.js.snap +++ b/crates/biome_js_formatter/tests/specs/prettier/js/sequence-expression/parenthesized.js.snap @@ -29,7 +29,6 @@ info: js/sequence-expression/parenthesized.js // ) // /* 10 */ // ); - ``` diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/sequence-parentheses/export-default.js b/crates/biome_js_formatter/tests/specs/prettier/js/sequence-parentheses/export-default.js deleted file mode 100644 index a7aa3bf3f232..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/sequence-parentheses/export-default.js +++ /dev/null @@ -1,2 +0,0 @@ -export default (1, -2); diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/sequence-parentheses/export-default.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/sequence-parentheses/export-default.js.prettier-snap deleted file mode 100644 index 939b016f2403..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/sequence-parentheses/export-default.js.prettier-snap +++ /dev/null @@ -1 +0,0 @@ -export default (1, 2); diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js b/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js new file mode 100644 index 000000000000..cfac6407c2d5 --- /dev/null +++ b/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js @@ -0,0 +1,9 @@ +// FIXME +// TODO: reformat issue +export const MSG_GENERIC_OPERATION_FAILURE_BODY_1 = + goog.getMsg("That's all we know"); + +// FIXME +// TODO: reformat issue +// export const MSG_GENERIC_OPERATION_FAILURE_BODY_2 = +// goog.getMsg("That\'s all we know"); diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js.prettier-snap new file mode 100644 index 000000000000..d095641f07d3 --- /dev/null +++ b/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js.prettier-snap @@ -0,0 +1,6 @@ +export const MSG_GENERIC_OPERATION_FAILURE_BODY_1 = + goog.getMsg("That's all we know"); + +export const MSG_GENERIC_OPERATION_FAILURE_BODY_2 = goog.getMsg( + "That's all we know", +); diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js.snap b/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js.snap new file mode 100644 index 000000000000..20aecb270c8b --- /dev/null +++ b/crates/biome_js_formatter/tests/specs/prettier/js/strings/escaped.js.snap @@ -0,0 +1,56 @@ +--- +source: crates/biome_formatter_test/src/snapshot_builder.rs +info: js/strings/escaped.js +--- + +# Input + +```js +// FIXME +// TODO: reformat issue +export const MSG_GENERIC_OPERATION_FAILURE_BODY_1 = + goog.getMsg("That's all we know"); + +// FIXME +// TODO: reformat issue +// export const MSG_GENERIC_OPERATION_FAILURE_BODY_2 = +// goog.getMsg("That\'s all we know"); + +``` + + +# Prettier differences + +```diff +--- Prettier ++++ Biome +@@ -1,6 +1,9 @@ ++// FIXME ++// TODO: reformat issue + export const MSG_GENERIC_OPERATION_FAILURE_BODY_1 = + goog.getMsg("That's all we know"); + +-export const MSG_GENERIC_OPERATION_FAILURE_BODY_2 = goog.getMsg( +- "That's all we know", +-); ++// FIXME ++// TODO: reformat issue ++// export const MSG_GENERIC_OPERATION_FAILURE_BODY_2 = ++// goog.getMsg("That\'s all we know"); +``` + +# Output + +```js +// FIXME +// TODO: reformat issue +export const MSG_GENERIC_OPERATION_FAILURE_BODY_1 = + goog.getMsg("That's all we know"); + +// FIXME +// TODO: reformat issue +// export const MSG_GENERIC_OPERATION_FAILURE_BODY_2 = +// goog.getMsg("That\'s all we know"); +``` + + diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/trailing-whitespace/trailing.js b/crates/biome_js_formatter/tests/specs/prettier/js/trailing-whitespace/trailing.js deleted file mode 100644 index 2d23f824bef6..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/trailing-whitespace/trailing.js +++ /dev/null @@ -1,10 +0,0 @@ -export type Result = | { kind: "not-test-editor1" } | { kind: "not-test-editor2" }; - -// Note: there are trailing whitespace in this file -` - - -` + ` - - -`; diff --git a/crates/biome_js_formatter/tests/specs/prettier/js/trailing-whitespace/trailing.js.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/js/trailing-whitespace/trailing.js.prettier-snap deleted file mode 100644 index 1854612d0a7a..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/js/trailing-whitespace/trailing.js.prettier-snap +++ /dev/null @@ -1,13 +0,0 @@ -export type Result = - | { kind: "not-test-editor1" } - | { kind: "not-test-editor2" }; - -// Note: there are trailing whitespace in this file -` - - -` + - ` - - -`; diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/after_jsx_generic.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/after_jsx_generic.ts deleted file mode 100644 index a3825662eacb..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/after_jsx_generic.ts +++ /dev/null @@ -1,25 +0,0 @@ -let comp = ( - <> - /* comment1 */> - foo /* comment2 */> - /* comment3 */ bar> - foo /* comment4 */ bar> - - - // comment5 - > - - foo - // comment6 - > - - // comment7 - foo - > - - foo - // comment8 - bar - > - -); diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/after_jsx_generic.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/after_jsx_generic.ts.prettier-snap deleted file mode 100644 index c178abb05ee0..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/after_jsx_generic.ts.prettier-snap +++ /dev/null @@ -1,25 +0,0 @@ -let comp = ( - <> - /* comment1 */> - foo /* comment2 */> - /* comment3 */ bar> - foo /* comment4 */ bar> - - - // comment5 - > - - foo - // comment6 - > - - // comment7 - foo - > - - foo - // comment8 - bar - > - -); diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/jsx.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/jsx.ts deleted file mode 100644 index da5adae25b51..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/jsx.ts +++ /dev/null @@ -1,7 +0,0 @@ -var example1 =
- https://test -
; - -var example2 =
- /*test*/ -
; diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/jsx.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/jsx.ts.prettier-snap deleted file mode 100644 index a400335ea460..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/comments/jsx.ts.prettier-snap +++ /dev/null @@ -1,3 +0,0 @@ -var example1 =
https://test
; - -var example2 =
/*test*/
; diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts deleted file mode 100644 index 8baacf4ea544..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts +++ /dev/null @@ -1 +0,0 @@ -const \ No newline at end of file diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts.prettier-snap deleted file mode 100644 index c53e6c279527..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts.prettier-snap +++ /dev/null @@ -1 +0,0 @@ -const; diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts.snap deleted file mode 100644 index 2c6eab53d6ff..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/downlevelLetConst1.ts.snap +++ /dev/null @@ -1,46 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: typescript/compiler/downlevelLetConst1.ts ---- - -# Input - -```ts -const -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -1 +1 @@ --const; -+const -``` - -# Output - -```ts -const -``` - -# Errors -``` -downlevelLetConst1.ts:1:6 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected an identifier, an array pattern, or an object pattern but instead found the end of the file. - - > 1 │ const - │ - - i Expected an identifier, an array pattern, or an object pattern here. - - > 1 │ const - │ - - -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts deleted file mode 100644 index 85413b73366a..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo { - bar: number = 5; -} diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts.prettier-snap deleted file mode 100644 index fdb0133bc763..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts.prettier-snap +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo { - bar: number = 5; -} diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts.snap deleted file mode 100644 index e64d15e261c1..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/compiler/errorOnInitializerInInterfaceProperty.ts.snap +++ /dev/null @@ -1,89 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: typescript/compiler/errorOnInitializerInInterfaceProperty.ts ---- - -# Input - -```ts -interface Foo { - bar: number = 5; -} - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -1,3 +1,3 @@ - interface Foo { -- bar: number = 5; -+ bar: number = 5 - } -``` - -# Output - -```ts -interface Foo { - bar: number = 5 -} -``` - -# Errors -``` -errorOnInitializerInInterfaceProperty.ts:2:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × ';' expected' - - 1 │ interface Foo { - > 2 │ bar: number = 5; - │ ^ - 3 │ } - 4 │ - - i An explicit or implicit semicolon is expected here... - -errorOnInitializerInInterfaceProperty.ts:2:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a property, or a signature but instead found ';'. - - 1 │ interface Foo { - > 2 │ bar: number = 5; - │ ^ - 3 │ } - 4 │ - - i Expected a property, or a signature here. - - 1 │ interface Foo { - > 2 │ bar: number = 5; - │ ^ - 3 │ } - 4 │ - -errorOnInitializerInInterfaceProperty.ts:3:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a statement but instead found '}'. - - 1 │ interface Foo { - 2 │ bar: number = 5; - > 3 │ } - │ ^ - 4 │ - - i Expected a statement here. - - 1 │ interface Foo { - 2 │ bar: number = 5; - > 3 │ } - │ ^ - 4 │ - - -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts deleted file mode 100644 index 45aeaa9cb9ca..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts +++ /dev/null @@ -1 +0,0 @@ -abstract interface I {} diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts.prettier-snap deleted file mode 100644 index 45aeaa9cb9ca..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts.prettier-snap +++ /dev/null @@ -1 +0,0 @@ -abstract interface I {} diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts.snap deleted file mode 100644 index af3f0c32e389..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/conformance/types/abstractKeyword/abstractKeyword.ts.snap +++ /dev/null @@ -1,57 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: typescript/conformance/types/abstractKeyword/abstractKeyword.ts ---- - -# Input - -```ts -abstract interface I {} - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -1 +1,2 @@ --abstract interface I {} -+abstract; -+interface I {} -``` - -# Output - -```ts -abstract; -interface I {} -``` - -# Errors -``` -abstractKeyword.ts:1:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - > 1 │ abstract interface I {} - │ ^^^^^^^^^ - 2 │ - - i An explicit or implicit semicolon is expected here... - - > 1 │ abstract interface I {} - │ ^^^^^^^^^ - 2 │ - - i ...Which is required to end this statement - - > 1 │ abstract interface I {} - │ ^^^^^^^^^^^^^^^^^^ - 2 │ - - -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/instantiation-expression/property-access.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/instantiation-expression/property-access.ts index 8a122521b179..3cac68cb2774 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/instantiation-expression/property-access.ts +++ b/crates/biome_js_formatter/tests/specs/prettier/typescript/instantiation-expression/property-access.ts @@ -13,4 +13,4 @@ // (Array)?.["a"]; // (Array)[`a`]; // (Array)?.[`a`]; -// (Array)[(Array)]; +// (Array)[(Array)]; \ No newline at end of file diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/instantiation-expression/property-access.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/instantiation-expression/property-access.ts.snap index 17e665fb0b7a..9d5c0a14f72b 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/instantiation-expression/property-access.ts.snap +++ b/crates/biome_js_formatter/tests/specs/prettier/typescript/instantiation-expression/property-access.ts.snap @@ -22,7 +22,6 @@ info: typescript/instantiation-expression/property-access.ts // (Array)[`a`]; // (Array)?.[`a`]; // (Array)[(Array)]; - ``` diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts deleted file mode 100644 index e5e1cb201116..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts +++ /dev/null @@ -1,3 +0,0 @@ -abstract interface I { - -} diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts.prettier-snap deleted file mode 100644 index 45aeaa9cb9ca..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts.prettier-snap +++ /dev/null @@ -1 +0,0 @@ -abstract interface I {} diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts.snap deleted file mode 100644 index 7457d845c337..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface/abstract.ts.snap +++ /dev/null @@ -1,62 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: typescript/interface/abstract.ts ---- - -# Input - -```ts -abstract interface I { - -} - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -1 +1,2 @@ --abstract interface I {} -+abstract; -+interface I {} -``` - -# Output - -```ts -abstract; -interface I {} -``` - -# Errors -``` -abstract.ts:1:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a semicolon or an implicit semicolon after a statement, but found none - - > 1 │ abstract interface I { - │ ^^^^^^^^^ - 2 │ - 3 │ } - - i An explicit or implicit semicolon is expected here... - - > 1 │ abstract interface I { - │ ^^^^^^^^^ - 2 │ - 3 │ } - - i ...Which is required to end this statement - - > 1 │ abstract interface I { - │ ^^^^^^^^^^^^^^^^^^ - 2 │ - 3 │ } - - -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts deleted file mode 100644 index 3bf95b1df837..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts +++ /dev/null @@ -1,66 +0,0 @@ -export interface Environment1 extends GenericEnvironment< - SomeType, - AnotherType, - YetAnotherType, -> { - m(): void; -}; -export class Environment2 extends GenericEnvironment< - SomeType, - AnotherType, - YetAnotherType, - DifferentType1, - DifferentType2, - DifferentType3, - DifferentType4, -> { - m() {}; -}; - -// Declare Interface Break -declare interface ExtendsOne extends ASingleInterface { - x: string; -} - -declare interface ExtendsLarge extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -declare interface ExtendsMany extends Interface1, Interface2, Interface3, Interface4, Interface5, Interface6, Interface7 { - x: string; -} - -// Interface declaration break -interface ExtendsOne extends ASingleInterface { - x: string; -} - -interface ExtendsLarge extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -interface ExtendsMany extends Interface1, Interface2, Interface3, Interface4, Interface5, Interface6, Interface7 { - s: string; -} - -// Generic Types -interface ExtendsOne extends ASingleInterface { - x: string; -} - -interface ExtendsLarge extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -interface ExtendsMany - extends ASingleGenericInterface { - x: string; -} - -interface ExtendsManyWithGenerics - extends InterfaceOne, InterfaceTwo, ASingleGenericInterface, InterfaceThree { - - x: string; - } - -export interface ExtendsLongOneWithGenerics extends Bar< SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, ToBreakLineToBreakLineToBreakLine> {} diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts.prettier-snap deleted file mode 100644 index 494ce0478df8..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts.prettier-snap +++ /dev/null @@ -1,102 +0,0 @@ -export interface Environment1 - extends GenericEnvironment { - m(): void; -} -export class Environment2 extends GenericEnvironment< - SomeType, - AnotherType, - YetAnotherType, - DifferentType1, - DifferentType2, - DifferentType3, - DifferentType4 -> { - m() {} -} - -// Declare Interface Break -declare interface ExtendsOne extends ASingleInterface { - x: string; -} - -declare interface ExtendsLarge - extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -declare interface ExtendsMany - extends Interface1, - Interface2, - Interface3, - Interface4, - Interface5, - Interface6, - Interface7 { - x: string; -} - -// Interface declaration break -interface ExtendsOne extends ASingleInterface { - x: string; -} - -interface ExtendsLarge - extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -interface ExtendsMany - extends Interface1, - Interface2, - Interface3, - Interface4, - Interface5, - Interface6, - Interface7 { - s: string; -} - -// Generic Types -interface ExtendsOne extends ASingleInterface { - x: string; -} - -interface ExtendsLarge - extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -interface ExtendsMany - extends ASingleGenericInterface< - Interface1, - Interface2, - Interface3, - Interface4, - Interface5, - Interface6, - Interface7 - > { - x: string; -} - -interface ExtendsManyWithGenerics - extends InterfaceOne, - InterfaceTwo, - ASingleGenericInterface< - Interface1, - Interface2, - Interface3, - Interface4, - Interface5, - Interface6, - Interface7 - >, - InterfaceThree { - x: string; -} - -export interface ExtendsLongOneWithGenerics - extends Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine - > {} diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts.snap deleted file mode 100644 index 91be891b3bac..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/interface2/break.ts.snap +++ /dev/null @@ -1,264 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: typescript/interface2/break.ts ---- - -# Input - -```ts -export interface Environment1 extends GenericEnvironment< - SomeType, - AnotherType, - YetAnotherType, -> { - m(): void; -}; -export class Environment2 extends GenericEnvironment< - SomeType, - AnotherType, - YetAnotherType, - DifferentType1, - DifferentType2, - DifferentType3, - DifferentType4, -> { - m() {}; -}; - -// Declare Interface Break -declare interface ExtendsOne extends ASingleInterface { - x: string; -} - -declare interface ExtendsLarge extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -declare interface ExtendsMany extends Interface1, Interface2, Interface3, Interface4, Interface5, Interface6, Interface7 { - x: string; -} - -// Interface declaration break -interface ExtendsOne extends ASingleInterface { - x: string; -} - -interface ExtendsLarge extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -interface ExtendsMany extends Interface1, Interface2, Interface3, Interface4, Interface5, Interface6, Interface7 { - s: string; -} - -// Generic Types -interface ExtendsOne extends ASingleInterface { - x: string; -} - -interface ExtendsLarge extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -interface ExtendsMany - extends ASingleGenericInterface { - x: string; -} - -interface ExtendsManyWithGenerics - extends InterfaceOne, InterfaceTwo, ASingleGenericInterface, InterfaceThree { - - x: string; - } - -export interface ExtendsLongOneWithGenerics extends Bar< SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, ToBreakLineToBreakLineToBreakLine> {} - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -1,5 +1,8 @@ --export interface Environment1 -- extends GenericEnvironment { -+export interface Environment1 extends GenericEnvironment< -+ SomeType, -+ AnotherType, -+ YetAnotherType, -+> { - m(): void; - } - export class Environment2 extends GenericEnvironment< -@@ -9,9 +12,9 @@ - DifferentType1, - DifferentType2, - DifferentType3, -- DifferentType4 -+ DifferentType4, - > { -- m() {} -+ m() {}; - } - - // Declare Interface Break -``` - -# Output - -```ts -export interface Environment1 extends GenericEnvironment< - SomeType, - AnotherType, - YetAnotherType, -> { - m(): void; -} -export class Environment2 extends GenericEnvironment< - SomeType, - AnotherType, - YetAnotherType, - DifferentType1, - DifferentType2, - DifferentType3, - DifferentType4, -> { - m() {}; -} - -// Declare Interface Break -declare interface ExtendsOne extends ASingleInterface { - x: string; -} - -declare interface ExtendsLarge - extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -declare interface ExtendsMany - extends Interface1, - Interface2, - Interface3, - Interface4, - Interface5, - Interface6, - Interface7 { - x: string; -} - -// Interface declaration break -interface ExtendsOne extends ASingleInterface { - x: string; -} - -interface ExtendsLarge - extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -interface ExtendsMany - extends Interface1, - Interface2, - Interface3, - Interface4, - Interface5, - Interface6, - Interface7 { - s: string; -} - -// Generic Types -interface ExtendsOne extends ASingleInterface { - x: string; -} - -interface ExtendsLarge - extends ASingleInterfaceWithAReallyReallyReallyReallyLongName { - x: string; -} - -interface ExtendsMany - extends ASingleGenericInterface< - Interface1, - Interface2, - Interface3, - Interface4, - Interface5, - Interface6, - Interface7 - > { - x: string; -} - -interface ExtendsManyWithGenerics - extends InterfaceOne, - InterfaceTwo, - ASingleGenericInterface< - Interface1, - Interface2, - Interface3, - Interface4, - Interface5, - Interface6, - Interface7 - >, - InterfaceThree { - x: string; -} - -export interface ExtendsLongOneWithGenerics - extends Bar< - SomeLongTypeSomeLongTypeSomeLongTypeSomeLongType, - ToBreakLineToBreakLineToBreakLine - > {} -``` - -# Errors -``` -break.ts:5:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a type parameter but instead found '>'. - - 3 │ AnotherType, - 4 │ YetAnotherType, - > 5 │ > { - │ ^ - 6 │ m(): void; - 7 │ }; - - i Expected a type parameter here. - - 3 │ AnotherType, - 4 │ YetAnotherType, - > 5 │ > { - │ ^ - 6 │ m(): void; - 7 │ }; - -break.ts:16:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × Expected a type parameter but instead found '>'. - - 14 │ DifferentType3, - 15 │ DifferentType4, - > 16 │ > { - │ ^ - 17 │ m() {}; - 18 │ }; - - i Expected a type parameter here. - - 14 │ DifferentType3, - 15 │ DifferentType4, - > 16 │ > { - │ ^ - 17 │ m() {}; - 18 │ }; - - -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/intersection/intersection-parens.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/intersection/intersection-parens.ts deleted file mode 100644 index b19671acd128..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/intersection/intersection-parens.ts +++ /dev/null @@ -1,43 +0,0 @@ -type A = (number | string) & boolean; -type B = ((number | string)) & boolean; -type C = (((number | string))) & boolean; -type D = ((((number | string)))) & boolean; - -let b1 : C; -let b2 : & C; -let b3 : (& C); -let b4 : & (C); -let b5 : (& (C)); -let b6 : /*1*/ & C; -let b7 : /*1*/ & (C); -let b8 : /*1*/ (& C); -let b9 : (/*1*/ & C); -let b10: /*1*/ & /*2*/ C; -let b11: /*1*/ (& /*2*/ C); - -let bb1: /*1*/ & /*2*/ C & D; -let bb2: /*1*/ & /*2*/ C & /*3*/ D; -let bb3: /*1*/ & /*2*/ C & /*3*/ D /*5*/; - -type B2 = & C; -type B3 = (& C); -type B4 = & (C); -type B5 = (& (C)); -type B6 = /*1*/ & C; -type B7 = /*1*/ & (C); -type B8 = /*1*/ (& C); -type B9 = (/*1*/ & C); -type B10 = /*1*/ & /*2*/ C; -type B11 = /*1*/ (& /*2*/ C); -type B12 = /*1*/ & ( (C)); - -type Bb1 = /*1*/ & /*2*/ C & D; -type Bb2 = /*1*/ & /*2*/ C & /*3*/ D; -type Bb3 = /*1*/ & /*2*/ C & /*3*/ D /*4*/; - -type D1 = /*1*/ | a & b; -type D2 = /*1*/ | a & (b); -type D3 = /*1*/ | a & (| b); -type D4 = /*1*/ | (a & b); -type D5 = /*1*/ (| a & b); -type D6 /*0*/ = /*1*/ (| a & b); diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/intersection/intersection-parens.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/intersection/intersection-parens.ts.prettier-snap deleted file mode 100644 index fe694977bc6e..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/intersection/intersection-parens.ts.prettier-snap +++ /dev/null @@ -1,43 +0,0 @@ -type A = (number | string) & boolean; -type B = (number | string) & boolean; -type C = (number | string) & boolean; -type D = (number | string) & boolean; - -let b1: C; -let b2: C; -let b3: C; -let b4: C; -let b5: C; -let b6: /*1*/ C; -let b7: /*1*/ C; -let b8: /*1*/ C; -let b9: /*1*/ C; -let b10: /*1*/ /*2*/ C; -let b11: /*1*/ /*2*/ C; - -let bb1: /*1*/ /*2*/ C & D; -let bb2: /*1*/ /*2*/ C & /*3*/ D; -let bb3: /*1*/ /*2*/ C & /*3*/ D /*5*/; - -type B2 = C; -type B3 = C; -type B4 = C; -type B5 = C; -type B6 = /*1*/ C; -type B7 = /*1*/ C; -type B8 = /*1*/ C; -type B9 = /*1*/ C; -type B10 = /*1*/ /*2*/ C; -type B11 = /*1*/ /*2*/ C; -type B12 = /*1*/ C; - -type Bb1 = /*1*/ /*2*/ C & D; -type Bb2 = /*1*/ /*2*/ C & /*3*/ D; -type Bb3 = /*1*/ /*2*/ C & /*3*/ D /*4*/; - -type D1 = /*1*/ a & b; -type D2 = /*1*/ a & b; -type D3 = /*1*/ a & b; -type D4 = /*1*/ a & b; -type D5 = /*1*/ a & b; -type D6 /*0*/ = /*1*/ a & b; diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts deleted file mode 100644 index b340165235cd..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts +++ /dev/null @@ -1,19 +0,0 @@ -export const Foo = forwardRef((props: FooProps, ref: Ref): JSX.Element => { - return
; -}); - -export const Bar = forwardRef((props: BarProps, ref: Ref): JSX.Element | null => { - return
; -}); - -users.map((user: User): User => { - return user; -}) - -users.map((user: User): User => { - ; // comment -}) - -users.map((user: User): User => { - // comment -}) diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts.prettier-snap deleted file mode 100644 index 11340dee601f..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts.prettier-snap +++ /dev/null @@ -1,23 +0,0 @@ -export const Foo = forwardRef( - (props: FooProps, ref: Ref): JSX.Element => { - return
; - }, -); - -export const Bar = forwardRef( - (props: BarProps, ref: Ref): JSX.Element | null => { - return
; - }, -); - -users.map((user: User): User => { - return user; -}); - -users.map((user: User): User => { - // comment -}); - -users.map((user: User): User => { - // comment -}); diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts.snap deleted file mode 100644 index 3a0ac58177f6..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/typeparams/print-width-120/issue-7542.ts.snap +++ /dev/null @@ -1,165 +0,0 @@ ---- -source: crates/biome_formatter_test/src/snapshot_builder.rs -info: typescript/typeparams/print-width-120/issue-7542.ts ---- - -# Input - -```ts -export const Foo = forwardRef((props: FooProps, ref: Ref): JSX.Element => { - return
; -}); - -export const Bar = forwardRef((props: BarProps, ref: Ref): JSX.Element | null => { - return
; -}); - -users.map((user: User): User => { - return user; -}) - -users.map((user: User): User => { - ; // comment -}) - -users.map((user: User): User => { - // comment -}) - -``` - - -# Prettier differences - -```diff ---- Prettier -+++ Biome -@@ -14,9 +14,11 @@ - return user; - }); - --users.map((user: User): User => { -- // comment --}); -+users.map( -+ (user: User): User => { -+ // comment -+ }, -+); - - users.map((user: User): User => { - // comment -``` - -# Output - -```ts -export const Foo = forwardRef( - (props: FooProps, ref: Ref): JSX.Element => { - return
; - }, -); - -export const Bar = forwardRef( - (props: BarProps, ref: Ref): JSX.Element | null => { - return
; - }, -); - -users.map((user: User): User => { - return user; -}); - -users.map( - (user: User): User => { - // comment - }, -); - -users.map((user: User): User => { - // comment -}); -``` - -# Errors -``` -issue-7542.ts:2:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `>` but instead found `/` - - 1 │ export const Foo = forwardRef((props: FooProps, ref: Ref): JSX.Element => { - > 2 │ return
; - │ ^ - 3 │ }); - 4 │ - - i Remove / - -issue-7542.ts:2:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unterminated regex literal - - 1 │ export const Foo = forwardRef((props: FooProps, ref: Ref): JSX.Element => { - > 2 │ return
; - │ - 3 │ }); - 4 │ - - i ...but the line ends here - - 1 │ export const Foo = forwardRef((props: FooProps, ref: Ref): JSX.Element => { - > 2 │ return
; - │ - 3 │ }); - 4 │ - - i a regex literal starts there... - - 1 │ export const Foo = forwardRef((props: FooProps, ref: Ref): JSX.Element => { - > 2 │ return
; - │ ^ - 3 │ }); - 4 │ - -issue-7542.ts:6:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × expected `>` but instead found `/` - - 5 │ export const Bar = forwardRef((props: BarProps, ref: Ref): JSX.Element | null => { - > 6 │ return
; - │ ^ - 7 │ }); - 8 │ - - i Remove / - -issue-7542.ts:6:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - - × unterminated regex literal - - 5 │ export const Bar = forwardRef((props: BarProps, ref: Ref): JSX.Element | null => { - > 6 │ return
; - │ - 7 │ }); - 8 │ - - i ...but the line ends here - - 5 │ export const Bar = forwardRef((props: BarProps, ref: Ref): JSX.Element | null => { - > 6 │ return
; - │ - 7 │ }); - 8 │ - - i a regex literal starts there... - - 5 │ export const Bar = forwardRef((props: BarProps, ref: Ref): JSX.Element | null => { - > 6 │ return
; - │ ^ - 7 │ }); - 8 │ - - -``` - - diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/consistent-with-flow/single-type.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/consistent-with-flow/single-type.ts index e4d3ff83a3ba..7083f102bd50 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/consistent-with-flow/single-type.ts +++ b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/consistent-with-flow/single-type.ts @@ -79,4 +79,4 @@ // ) // ) // ) -// ); +// ); \ No newline at end of file diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/consistent-with-flow/single-type.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/consistent-with-flow/single-type.ts.snap index 389b32ca1d7f..955c782322c7 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/consistent-with-flow/single-type.ts.snap +++ b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/consistent-with-flow/single-type.ts.snap @@ -88,7 +88,6 @@ info: typescript/union/consistent-with-flow/single-type.ts // ) // ) // ); - ``` diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/inlining.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/inlining.ts index c9be5b235ed9..361119b453ce 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/inlining.ts +++ b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/inlining.ts @@ -15,7 +15,6 @@ interface RelayProps { | void, // articles type may be void } - // FIXME // TODO: reformat issue // type FooBar = null // null diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/inlining.ts.snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/inlining.ts.snap index 4ebba115d8b3..d2fb131304b9 100644 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/inlining.ts.snap +++ b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/inlining.ts.snap @@ -23,7 +23,6 @@ interface RelayProps { | void, // articles type may be void } - // FIXME // TODO: reformat issue // type FooBar = null // null diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/prettier-ignore.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/prettier-ignore.ts deleted file mode 100644 index 786b59686337..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/prettier-ignore.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type a = - // foo - | foo1&foo2 - // bar - | bar1&bar2 - // prettier-ignore - | qux1&qux2; - -export type a = - // foo - | foo1&foo2 - // bar - | bar1&bar2 - // prettier-ignore - | qux1&qux2 - // baz - | baz1&baz2; - -export type a = - // prettier-ignore - | foo1&foo2 - // bar - | bar1&bar2 - // qux - | qux1&qux2; diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/prettier-ignore.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/prettier-ignore.ts.prettier-snap deleted file mode 100644 index fff835c0f3c8..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/prettier-ignore.ts.prettier-snap +++ /dev/null @@ -1,25 +0,0 @@ -export type a = - // foo - | (foo1 & foo2) - // bar - | (bar1 & bar2) - // prettier-ignore - | qux1&qux2; - -export type a = - // foo - | (foo1 & foo2) - // bar - | (bar1 & bar2) - // prettier-ignore - | qux1&qux2 - // baz - | (baz1 & baz2); - -export type a = - // prettier-ignore - | foo1&foo2 - // bar - | (bar1 & bar2) - // qux - | (qux1 & qux2); diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/within-tuple.ts b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/within-tuple.ts deleted file mode 100644 index 7539bc9d7868..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/within-tuple.ts +++ /dev/null @@ -1,64 +0,0 @@ -type A = [AAAAAAAAAAAAAAAAAAAAAA | BBBBBBBBBBBBBBBBBBBBBB | CCCCCCCCCCCCCCCCCCCCCC | DDDDDDDDDDDDDDDDDDDDDD] - -type B = [ - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD -] - -type B1 = [ - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ) -] - -type C = [ - | [AAAAAAAAAAAAAAAAAAAAAA | BBBBBBBBBBBBBBBBBBBBBB | CCCCCCCCCCCCCCCCCCCCCC | DDDDDDDDDDDDDDDDDDDDDD] - | [AAAAAAAAAAAAAAAAAAAAAA | BBBBBBBBBBBBBBBBBBBBBB | CCCCCCCCCCCCCCCCCCCCCC | DDDDDDDDDDDDDDDDDDDDDD] -] - -type D = [ - (AAAAAAAAAAAAAAAAAAAAAA | BBBBBBBBBBBBBBBBBBBBBB | CCCCCCCCCCCCCCCCCCCCCC | DDDDDDDDDDDDDDDDDDDDDD), - (AAAAAAAAAAAAAAAAAAAAAA | BBBBBBBBBBBBBBBBBBBBBB | CCCCCCCCCCCCCCCCCCCCCC | DDDDDDDDDDDDDDDDDDDDDD) -] - -type D1 = [ - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ), - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ) -] - -type D2 = [ - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD, - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD -] - -type E = [ AA | BB, AA | BB ] - -type F = [ - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD, - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB -] diff --git a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/within-tuple.ts.prettier-snap b/crates/biome_js_formatter/tests/specs/prettier/typescript/union/within-tuple.ts.prettier-snap deleted file mode 100644 index 451e7b9383c0..000000000000 --- a/crates/biome_js_formatter/tests/specs/prettier/typescript/union/within-tuple.ts.prettier-snap +++ /dev/null @@ -1,92 +0,0 @@ -type A = [ - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD, -]; - -type B = [ - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD, -]; - -type B1 = [ - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD, -]; - -type C = [ - | [ - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD, - ] - | [ - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD, - ], -]; - -type D = [ - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ), - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ), -]; - -type D1 = [ - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ), - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ), -]; - -type D2 = [ - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ), - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ), -]; - -type E = [AA | BB, AA | BB]; - -type F = [ - ( - | AAAAAAAAAAAAAAAAAAAAAA - | BBBBBBBBBBBBBBBBBBBBBB - | CCCCCCCCCCCCCCCCCCCCCC - | DDDDDDDDDDDDDDDDDDDDDD - ), - AAAAAAAAAAAAAAAAAAAAAA | BBBBBBBBBBBBBBBBBBBBBB, -]; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 11fee9b87d02..86ad6f5f07d6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,8 +78,6 @@ importers: specifier: ^0.22.0 version: 0.22.0 - packages/@biomejs/wasm-web: {} - website: devDependencies: '@astrojs/prism':