diff --git a/crates/biome_js_formatter/report.md b/crates/biome_js_formatter/report.md new file mode 100644 index 000000000000..a01762461b35 --- /dev/null +++ b/crates/biome_js_formatter/report.md @@ -0,0 +1,16755 @@ +# Overall Metrics + +**Average compatibility**: 91.42 + +
+ Definition + + $$average = \frac\{\sum_{file}^\{files}compatibility_\{file}}\{files}$$ +
+ +**Compatible lines**: 93.04 +
+ Definition + + $$average = \frac{\sum_{file}^{files}matching\_lines_{file}}{max(lines_{rome}, lines_{prettier})}$$ +
+ + +[Metric definition discussion](https://github.com/rome/tools/issues/2555#issuecomment-1124787893) + + +# js/array-spread/multiple.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/empty.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/holes-in-args.js +```diff +-new Test().test().test([, 0]).test(); ++new Test() ++ .test() ++ .test([, 0]) ++ .test(); + +``` + +**Prettier Similarity**: 0.00% + + +# js/arrays/issue-10159.js +```diff + { + 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_432, ++ ]) { + } + } + { + for (const srcPath of [ + 123, 123_123_123, 123_123_123_1, 13_123_3123_31_4321, + ]) { + } + } + +``` + +**Prettier Similarity**: 85.00% + + +# js/arrays/last.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/nested.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/numbers-in-args.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/numbers-in-assignment.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/numbers-negative-comment-after-minus.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/numbers-negative.js +```diff + const numbers1 = [ + -2017, -506252, -744011292, -7224, -70.4, -83353.6, -708.4, -174023963.52, + -40385, + // comment1 +- -380014, -253951682, -728, -15.84, -2058467564.56, -43, -33, -85134845, +- -67092, -1, -78820379, -2371.6, -16, 7, ++ -380014, ++ -253951682, -728, -15.84, -2058467564.56, -43, -33, -85134845, -67092, -1, ++ -78820379, -2371.6, -16, 7, + // comment2 +- -62454, -4282239912, -10816495.36, 0.88, -100622682, 8.8, -67087.68000000001, ++ -62454, ++ -4282239912, -10816495.36, 0.88, -100622682, 8.8, -67087.68000000001, + -3758276, -25.5211, -54, -1184265243, -46073628, -280423.44, -41833463, + -27961.12, -305.36, -199875.28, + ]; + + const numbers2 = [ + -234, + -342, // comment3 + -223, + -333333.33, + 12345, + ]; + +``` + +**Prettier Similarity**: 76.19% + + +# js/arrays/numbers-trailing-comma.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/numbers-with-holes.js +```diff + const numberWithHoles1 = [ + 7234932941, + 7234932722, + 7234932312, ++ // comment before a hole 1 + , +- // comment before a hole 1 + 7234932841, + , + 7234932843, +- , + // comment after a hole 1 ++ , + 7234932436, + ]; + + const numberWithHoles2 = [ + 0x234932941, + 0x234932722, + 0x234932312, +- ++ // comment before a hole 2 + , +- // comment before a hole 2 + 0x234932841, + , + 0x234932843, +- , + // comment after a hole 2 ++ , ++ + 0x234932436, + ]; + +``` + +**Prettier Similarity**: 82.14% + + +# js/arrays/numbers-with-trailing-comments.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/numbers-with-tricky-comments.js +```diff + const lazyCatererNumbers = [ + 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, 67, 79, 92, 106, 121, 137, 154, 172, + 191, 211, 232, 254, 277, 301, 326, 352, 379, 407, 436, 466 /*block*/, + // line +- 497, 529, 562, 596, 631, 667, 704, 742, 781, 821, 862, 904, 947, 991, 1036, +- 1082, 1129, 1177, 1226, ++ 497, ++ 529, 562, 596, 631, 667, 704, 742, 781, 821, 862, 904, 947, 991, 1036, 1082, ++ 1129, 1177, 1226, + // line 2 +- 1276, 1327, 1379, ++ 1276, ++ 1327, 1379, + ]; + +``` + +**Prettier Similarity**: 54.55% + + +# js/arrays/numbers1.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/numbers2.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/numbers3.js + +**Prettier Similarity**: 100.00% + + +# js/arrays/preserve_empty_lines.js + +**Prettier Similarity**: 100.00% + + +# js/arrow-call/arrow_call.js + +**Prettier Similarity**: 100.00% + + +# js/arrow-call/class-property.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/arrow-chain-with-trailing-comments.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/arrow_function_expression.js +```diff + ((a) => {}).length; + typeof (() => {}); + export default (() => {})(); + (() => {})()``; + (() => {})``; + new (() => {})(); + if ((() => {}) ? 1 : 0) { + } + let f = () => ({})(); + let a = () => ({}) instanceof a; + a = () => ({}) && a; + a = () => ({})() && a; + a = () => ({}) && a && b; + a = () => ({}) + a; + a = () => ({})()() && a; + a = () => ({}).b && a; + a = () => ({})[b] && a; + a = () => ({})`` && a; + a = () => ({} = 0); +-a = () => ({}, a); ++a = () => (({}), a); + (a) => a instanceof {}; + (a) => ({})().b && 0; +-(a) => ({}().c = 0); ++(a) => (({})().c = 0); + (x) => ({})()(); + (x) => ({})()``; + (x) => ({})().b; + a = (b) => c; + (x) => (y = z); + (x) => (y += z); + f((a) => ({})) + 1; + ((a) => ({})) || 0; + a = (b) => c; + a = (b) => { + return c; + }; + +``` + +**Prettier Similarity**: 94.29% + + +# js/arrows/assignment-chain-with-arrow-chain.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/block_like.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/call.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/chain-as-arg.js +```diff + const w = a.b( + ( +- c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- ) => ++ c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ ) => + (e) => + 0, + ); + + const x = a.b( + ( +- c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- ) => ++ c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ ) => + (e) => + 0, + )(x); + + const y = a.b( + 1, + ( +- c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- ) => ++ c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ ) => + (e) => + 0, + )(x); + + const z = a.b( + ( +- c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- ) => ++ c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ ) => + (e) => + 0, + 2, + )(x); + +``` + +**Prettier Similarity**: 67.57% + + +# js/arrows/chain-in-logical-expression.js +```diff + const x = + a.b ?? + (( +- c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", +- ) => ++ c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ d = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", ++ ) => + (e) => + 0); + +``` + +**Prettier Similarity**: 62.50% + + +# js/arrows/comment.js +```diff + /** + * Curried function that ends with a BEM CSS Selector + * + * @param {String} block - the BEM Block you'd like to select. + * @returns {Function} + */ + export const bem = + (block) => + /** + * @param {String} [element] - the BEM Element within that block; if undefined, selects the block itself. + * @returns {Function} + */ + (element) => + /** + * @param {?String} [modifier] - the BEM Modifier for the Block or Element; if undefined, selects the Block or Element unmodified. + * @returns {String} + */ + (modifier) => + [ + ".", + css(block), + element ? `__${css(element)}` : "", + modifier ? `--${css(modifier)}` : "", + ].join(""); + + {info.item.widget.missingProp}} + data={data} + />; + + func( +- () => +- // comment +- a, ++ () => a, // comment + ); + func( +- () => () => +- // comment +- a, ++ () => ++ () => // comment ++ a, + ); + func( +- () => () => () => +- // comment +- a, ++ () => ++ () => ++ () => // comment ++ a, + ); + +-func(() => +- // comment +- a ? b : c, ++func( ++ () => (a ? b : c), // comment + ); + func( +- () => () => +- // comment +- a ? b : c, ++ () => ++ () => // comment ++ a ? b : c, + ); + func( +- () => () => () => +- // comment +- a ? b : c, ++ () => ++ () => ++ () => // comment ++ a ? b : c, + ); + + func( +- () => +- ( +- // comment +- a, b, c +- ), ++ () => ( // comment ++ a, b, c ++ ), + ); + func( +- () => () => +- ( +- // comment ++ () => ++ () => ( // comment + a, b, c + ), + ); + func( +- () => () => () => +- ( +- // comment ++ () => ++ () => ++ () => ( // comment + a, b, c + ), + ); + +``` + +**Prettier Similarity**: 65.48% + + +# js/arrows/curried.js +```diff + const fn1 = (a) => 3; + const fn2 = (a) => (b) => 3; + const fn3 = (a) => (b) => (c) => 3; + const fn4 = (a) => (b) => (c) => (d) => 3; + const fn5 = (a) => (b) => (c) => (d) => (e) => 3; + const fn6 = (a) => (b) => (c) => (d) => (e) => (g) => 3; + const fn7 = (a) => (b) => (c) => (d) => (e) => (g) => (f) => 3; + + const fn8 = (a) => ({ foo: bar, bar: baz, baz: foo }); + const fn9 = (a) => (b) => ({ foo: bar, bar: baz, baz: foo }); + const fn10 = (a) => (b) => (c) => ({ foo: bar, bar: baz, baz: foo }); + const fn11 = (a) => (b) => (c) => (d) => ({ foo: bar, bar: baz, baz: foo }); + const fn12 = (a) => (b) => (c) => (d) => (e) => ({ + foo: bar, + bar: baz, + baz: foo, + }); + const fn13 = (a) => (b) => (c) => (d) => (e) => (g) => ({ + foo: bar, + bar: baz, + baz: foo, + }); + const fn14 = (a) => (b) => (c) => (d) => (e) => (g) => (f) => ({ + foo: bar, + bar: baz, + baz: foo, + }); + + const curryTest = + (argument1) => + (argument2) => + (argument3) => + (argument4) => + (argument5) => + (argument6) => + (argument7) => + (argument8) => + (argument9) => + (argument10) => + (argument11) => + (argument12) => ({ + foo: argument1, + bar: argument2, + }); + + let curryTest2 = + (argument1) => + (argument2) => + (argument3) => + (argument4) => + (argument5) => + (argument6) => + (argument7) => + (argument8) => + (argument9) => + (argument10) => + (argument11) => + (argument12) => { + const foo = "foo"; + return foo + "bar"; + }; + + curryTest2 = + (argument1) => + (argument2) => + (argument3) => + (argument4) => + (argument5) => + (argument6) => + (argument7) => + (argument8) => + (argument9) => + (argument10) => + (argument11) => + (argument12) => { + const foo = "foo"; + return foo + "bar"; + }; + + throw (argument1) => + (argument2) => + (argument3) => + (argument4) => + (argument5) => + (argument6) => + (argument7) => + (argument8) => + (argument9) => + (argument10) => + (argument11) => + (argument12) => { + const foo = "foo"; + return foo + "bar"; + }; + + foo( + (argument1) => + (argument2) => + (argument3) => + (argument4) => + (argument5) => + (argument6) => + (argument7) => + (argument8) => + (argument9) => + (argument10) => + (argument11) => + (argument12) => + 3, + ); + +-foo( +- (argument1) => +- (argument2) => +- (argument3) => +- (argument4) => +- (argument5) => +- (argument6) => +- (argument7) => +- (argument8) => +- (argument9) => +- (argument10) => +- (argument11) => +- (argument12) => ({ +- foo: bar, +- bar: baz, +- baz: foo, +- }), +-); ++foo((argument1) => ++ (argument2) => ++ (argument3) => ++ (argument4) => ++ (argument5) => ++ (argument6) => ++ (argument7) => ++ (argument8) => ++ (argument9) => ++ (argument10) => ++ (argument11) => ++ (argument12) => ({ ++ foo: bar, ++ bar: baz, ++ baz: foo, ++ })); + +-foo( +- (argument1) => +- (argument2) => +- (argument3) => +- (argument4) => +- (argument5) => +- (argument6) => +- (argument7) => +- (argument8) => +- (argument9) => +- (argument10) => +- (argument11) => +- (argument12) => { +- const foo = "foo"; +- return foo + "bar"; +- }, +-); ++foo((argument1) => ++ (argument2) => ++ (argument3) => ++ (argument4) => ++ (argument5) => ++ (argument6) => ++ (argument7) => ++ (argument8) => ++ (argument9) => ++ (argument10) => ++ (argument11) => ++ (argument12) => { ++ const foo = "foo"; ++ return foo + "bar"; ++ }); + + ( + (argument1) => + (argument2) => + (argument3) => + (argument4) => + (argument5) => + (argument6) => + (argument7) => + (argument8) => + (argument9) => + (argument10) => + (argument11) => + (argument12) => + 3 + )(3); + + bar( +- foo( +- (argument1) => +- (argument2) => +- (argument3) => +- (argument4) => +- (argument5) => +- (argument6) => +- (argument7) => +- (argument8) => +- (argument9) => +- (argument10) => +- (argument11) => +- (argument12) => ({ +- foo: bar, +- bar: baz, +- }), +- ), ++ foo((argument1) => ++ (argument2) => ++ (argument3) => ++ (argument4) => ++ (argument5) => ++ (argument6) => ++ (argument7) => ++ (argument8) => ++ (argument9) => ++ (argument10) => ++ (argument11) => ++ (argument12) => ({ ++ foo: bar, ++ bar: baz, ++ })), + ); + + const baaaz = + (aaaaa1, bbbbb1) => + (aaaaa2, bbbbb2) => + (aaaaa3, bbbbb3) => + (aaaaa4, bbbbb4) => ({ + foo: bar, + }); + + new Fooooooooooooooooooooooooooooooooooooooooooooooooooo( + (action) => (next) => (next) => (next) => (next) => (next) => (next) => + dispatch(action), + ); + + foo?.Fooooooooooooooooooooooooooooooooooooooooooooooooooo( + (action) => (next) => (next) => (next) => (next) => (next) => (next) => + dispatch(action), + ); + + foo((action) => (action) => action); + +-import( +- (argument1) => +- (argument2) => +- (argument3) => +- (argument4) => +- (argument5) => +- (argument6) => +- (argument7) => +- (argument8) => +- (argument9) => +- (argument10) => +- (argument11) => +- (argument12) => { +- const foo = "foo"; +- return foo + "bar"; +- } +-); ++import((argument1) => ++ (argument2) => ++ (argument3) => ++ (argument4) => ++ (argument5) => ++ (argument6) => ++ (argument7) => ++ (argument8) => ++ (argument9) => ++ (argument10) => ++ (argument11) => ++ (argument12) => { ++ const foo = "foo"; ++ return foo + "bar"; ++ }); + +``` + +**Prettier Similarity**: 68.78% + + +# js/arrows/currying-2.js +```diff + const a = (x) => (y) => (z) => + x / 0.123456789 + (y * calculateSomething(z)) / Math.PI; + + request.get("https://preview-9992--prettier.netlify.app", (head) => (body) => { + console.log(head, body); + }); + +-request.get( +- "https://preview-9992--prettier.netlify.app", +- (head) => (body) => (mody) => { ++request.get("https://preview-9992--prettier.netlify.app", (head) => ++ (body) => ++ (mody) => { + console.log(head, body); +- }, +-); ++ }); + +-request.get( +- "https://preview-9992--prettier.netlify.app", +- (head) => +- (body) => +- (modyLoremIpsumDolorAbstractProviderFactoryServiceModule) => { +- console.log(head, body); +- }, +-); ++request.get("https://preview-9992--prettier.netlify.app", (head) => ++ (body) => ++ (modyLoremIpsumDolorAbstractProviderFactoryServiceModule) => { ++ console.log(head, body); ++ }); + +``` + +**Prettier Similarity**: 40.91% + + +# js/arrows/currying-3.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/currying-4.js +```diff + Y(() => (a ? b : c)); + +-Y(() => () => (a ? b : c)); ++Y(() => () => a ? b : c); + +-Y(() => () => () => (a ? b : c)); ++Y(() => () => () => a ? b : c); + + Y(() => + longlonglonglonglonglonglonglonglonglongCondition + ? "Prettier is an opinionated code formatter." + : "Prettier takes your code and reprints it from scratch by taking the line length into account.", + ); + + Y( + () => () => + longlonglonglonglonglonglonglonglonglongCondition + ? "Prettier is an opinionated code formatter." + : "Prettier takes your code and reprints it from scratch by taking the line length into account.", + ); + + Y( + () => () => () => + longlonglonglonglonglonglonglonglonglongCondition + ? "Prettier is an opinionated code formatter." + : "Prettier takes your code and reprints it from scratch by taking the line length into account.", + ); + + const x1 = () => [ + "The", + "green", + "dragon", + "liked", + "to", + "knit", + "sweaters", + "for", + "the", + "fluffy", + "clouds", + "in", + "the", + "sky.", + ]; + +-const x2 = () => () => [ +- "The", +- "green", +- "dragon", +- "liked", +- "to", +- "knit", +- "sweaters", +- "for", +- "the", +- "fluffy", +- "clouds", +- "in", +- "the", +- "sky.", +-]; ++const x2 = () => () => ++ [ ++ "The", ++ "green", ++ "dragon", ++ "liked", ++ "to", ++ "knit", ++ "sweaters", ++ "for", ++ "the", ++ "fluffy", ++ "clouds", ++ "in", ++ "the", ++ "sky.", ++ ]; + +-const x3 = () => () => () => [ +- "The", +- "green", +- "dragon", +- "liked", +- "to", +- "knit", +- "sweaters", +- "for", +- "the", +- "fluffy", +- "clouds", +- "in", +- "the", +- "sky.", +-]; ++const x3 = () => () => () => ++ [ ++ "The", ++ "green", ++ "dragon", ++ "liked", ++ "to", ++ "knit", ++ "sweaters", ++ "for", ++ "the", ++ "fluffy", ++ "clouds", ++ "in", ++ "the", ++ "sky.", ++ ]; + + f((a) => (1, 2, 3) /* a */); + f((a) => (b) => (1, 2, 3) /* b */ /* a */); +-f((a) => (b) => (c) => (1, 2, 3) /* c */ /* b */ /* a */); ++f((a) => (b) => (c) => (1, 2, 3) /* b */ /* c */ /* a */); + + f((a) => (1 ? 2 : 3) /* a */); +-f((a) => (b) => (1 ? 2 : 3) /* b */ /* a */); +-f((a) => (b) => (c) => (1 ? 2 : 3) /* c */ /* b */ /* a */); ++f((a) => (b) => 1 ? 2 : 3 /* b */ /* a */); ++f((a) => (b) => (c) => 1 ? 2 : 3 /* b */ /* c */ /* a */); + + a( + "", + "", + ({}) => + () => + () => + () => + () => + () => + () => + test, + ); + a( + "", + "", + ({}) => + () => + () => + () => + () => + () => + () => + test ? 1 : 2, + ); + +``` + +**Prettier Similarity**: 64.86% + + +# js/arrows/currying.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/issue-1389-curry.js +```diff + const foobar = + (argumentOne, argumentTwo, argumentThree) => + (...restOfTheArguments) => { + return "baz"; + }; + + const foobaz = + (argumentOne, argumentTwo, argumentThree) => (restOfTheArguments123, j) => { + return "baz"; + }; + +-const makeSomeFunction = +- (services = { logger: null }) => +- (a, b, c) => +- services.logger(a, b, c); ++const makeSomeFunction = (services = { logger: null }) => (a, b, c) => ++ services.logger(a, b, c); + + const makeSomeFunction2 = + ( + services = { + logger: null, + }, + ) => + (a, b, c) => + services.logger(a, b, c); + +``` + +**Prettier Similarity**: 83.33% + + +# js/arrows/issue-4166-curry.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/long-call-no-args.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/long-contents.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/newline-before-arrow/newline-before-arrow.js +```diff +-async (x) => x; ++async; ++x; ++=> x + +``` + +**Prettier Similarity**: 0.00% + + +# js/arrows/parens.js + +**Prettier Similarity**: 100.00% + + +# js/arrows/semi/semi.js + +**Prettier Similarity**: 100.00% + + +# js/assignment-comments/call.js + +**Prettier Similarity**: 100.00% + + +# js/assignment-comments/call2.js + +**Prettier Similarity**: 100.00% + + +# js/assignment-comments/function.js + +**Prettier Similarity**: 100.00% + + +# js/assignment-comments/identifier.js + +**Prettier Similarity**: 100.00% + + +# js/assignment-comments/number.js + +**Prettier Similarity**: 100.00% + + +# js/assignment-comments/string.js + +**Prettier Similarity**: 100.00% + + +# js/assignment-expression/assignment_expression.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/binaryish.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/call-with-template.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/chain-two-segments.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/chain.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/destructuring-array.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/destructuring-heuristic.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/destructuring.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/discussion-15196.js +```diff + async function f() { + const { section, rubric, authors, tags } = + await utils.upsertCommonData(mainData); + + const loooooooooooooooooooooooooong1 = + await looooooooooooooong.looooooooooooooong.loooooong; + const loooooooooooooooooooooooooong2 = + await looooooooooooooong.looooooooooooooong.loooooong(); + const loooooooooooooooooooooooooong3 = + await looooooooooooooooooooooooooooooooooooooooooooog(); +- const loooooooooooooooooooooooooong4 = +- !(await looooooooooooooong.looooooooooooooong.loooooong); +- const loooooooooooooooooooooooooong5 = +- void !!(await looooooooooooooong.looooooooooooooong.loooooong); ++ const loooooooooooooooooooooooooong4 = !(await looooooooooooooong ++ .looooooooooooooong.loooooong); ++ const loooooooooooooooooooooooooong5 = void !!(await looooooooooooooong ++ .looooooooooooooong.loooooong); + + const longlonglonglonglonglonglong1 = await new Promise((resolve, reject) => { + setTimeout(() => { + resolve("foo"); + }, 300); + }); + const longlonglonglonglonglonglong2 = await { + then(onFulfilled, onRejected) { + onFulfilled(1234567890); + }, + }; + } + + function* g() { + const { section, rubric, authors, tags } = + yield utils.upsertCommonData(mainData); + + const loooooooooooooooooooooooooong1 = + yield looooooooooooooong.looooooooooooooong.loooooong; + const loooooooooooooooooooooooooong2 = + yield looooooooooooooong.looooooooooooooong.loooooong(); + const loooooooooooooooooooooooooong3 = + yield looooooooooooooooooooooooooooooooooooooooooooog(); +- const loooooooooooooooooooooooooong4 = +- !(yield looooooooooooooong.looooooooooooooong.loooooong); +- const loooooooooooooooooooooooooong5 = +- void !!(yield looooooooooooooong.looooooooooooooong.loooooong); ++ const loooooooooooooooooooooooooong4 = !(yield looooooooooooooong ++ .looooooooooooooong.loooooong); ++ const loooooooooooooooooooooooooong5 = void !!(yield looooooooooooooong ++ .looooooooooooooong.loooooong); + const loooooooooooooooooooooooooong6 = + yield* looooooooooooooong.looooooooooooooong.loooooong; + + const longlonglonglonglonglonglong1 = yield qwertyuiop( + asdfghjkl, + zxcvbnm, + qwertyuiop, + asdfghjkl, + ); + const longlonglonglonglonglonglong2 = yield { + qwertyuiop: 1234567890, + asdfghjkl: 1234567890, + zxcvbnm: 123456789, + }; + + const x = yield; + } + +``` + +**Prettier Similarity**: 86.21% + + +# js/assignment/issue-10218.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-1419.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-15534.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-1966.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-2184.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-2482-1.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-2482-2.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-2540.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-3819.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-4094.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-5610.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-6922.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-7091.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-7572.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-7961.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/issue-8218.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/lone-arg.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/sequence.js + +**Prettier Similarity**: 100.00% + + +# js/assignment/unary.js + +**Prettier Similarity**: 100.00% + + +# js/async/async-iteration.js + +**Prettier Similarity**: 100.00% + + +# js/async/async-shorthand-method.js + +**Prettier Similarity**: 100.00% + + +# js/async/await-parse.js + +**Prettier Similarity**: 100.00% + + +# js/async/conditional-expression.js + +**Prettier Similarity**: 100.00% + + +# js/async/exponentiation.js + +**Prettier Similarity**: 100.00% + + +# js/async/inline-await.js + +**Prettier Similarity**: 100.00% + + +# js/async/nested.js + +**Prettier Similarity**: 100.00% + + +# js/async/nested2.js +```diff + async function f() { + await Promise.all( +- (await readdir("src")).map(async (path) => { ++ ( ++ await readdir("src") ++ ).map(async (path) => { + import(`./${path}`); + }), + ); + } + +``` + +**Prettier Similarity**: 66.67% + + +# js/async/parens.js + +**Prettier Similarity**: 100.00% + + +# js/async/simple-nested-await.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/async-generators.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/bigint.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/class-properties.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/class-static-block.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/decorator-auto-accessors.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/decorators.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/deferred-import-evaluation.js +```diff +-import defer * as ns from "x"; ++import defer ++* as ns from "x" + +``` + +**Prettier Similarity**: 0.00% + + +# js/babel-plugins/destructuring-private.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/dynamic-import.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/explicit-resource-management.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/export-namespace-from.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/function-sent.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/import-assertions-dynamic.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/import-assertions-static.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/import-attributes-dynamic.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/import-attributes-static.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/import-meta.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/import-reflection.js +```diff +-import module foo from "./module.wasm"; ++import module ++foo; ++from; ++("./module.wasm"); + +``` + +**Prettier Similarity**: 0.00% + + +# js/babel-plugins/jsx.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/logical-assignment-operators.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/module-string-names.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/nullish-coalescing-operator.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/numeric-separator.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/object-rest-spread.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/optional-catch-binding.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/optional-chaining-assignment.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/optional-chaining.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/private-fields-in-in.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/private-methods.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/regex-v-flag.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/regexp-modifiers.js + +**Prettier Similarity**: 100.00% + + +# js/babel-plugins/source-phase-imports.js +```diff +-import source fooSource from "foo"; ++import source ++fooSource; ++from; ++("foo"); + import.source("x"); + +``` + +**Prettier Similarity**: 20.00% + + +# js/big-int/literal.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/arrow.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/bitwise-flags.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/call.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/comment.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/equality.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/exp.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/if.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/in_instanceof.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/inline-jsx.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/inline-object-array.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/jsx_parent.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/like-regexp.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/math.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/return.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/short-right.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/test.js + +**Prettier Similarity**: 100.00% + + +# js/binary-expressions/unary.js + +**Prettier Similarity**: 100.00% + + +# js/binary_math/parens.js + +**Prettier Similarity**: 100.00% + + +# js/bracket-spacing/array.js + +**Prettier Similarity**: 100.00% + + +# js/bracket-spacing/object.js + +**Prettier Similarity**: 100.00% + + +# js/break-calls/break.js + +**Prettier Similarity**: 100.00% + + +# js/break-calls/parent.js + +**Prettier Similarity**: 100.00% + + +# js/break-calls/react.js + +**Prettier Similarity**: 100.00% + + +# js/break-calls/reduce.js + +**Prettier Similarity**: 100.00% + + +# js/call/first-argument-expansion/expression-2nd-arg.js +```diff + call(function () { + return 1; + }, 200_000_000_000n * askTrovenaBeenaDependsRowans); + +-call( +- function () { +- return 1; +- }, +- (200_000_000_000n * askTrovenaBeenaDependsRowans) / +- glimseGlyphsHazardNoopsTieTie, +-); ++call(function () { ++ return 1; ++}, (200_000_000_000n * askTrovenaBeenaDependsRowans) / ++ glimseGlyphsHazardNoopsTieTie); + +-call( +- function () { +- return 1; +- }, +- (askTrovenaBeenaDependsRowans = glimseGlyphsHazardNoopsTieTie = +- 200_000_000_000n), +-); ++call(function () { ++ return 1; ++}, (askTrovenaBeenaDependsRowans = glimseGlyphsHazardNoopsTieTie = ++ 200_000_000_000n)); + +``` + +**Prettier Similarity**: 26.32% + + +# js/call/first-argument-expansion/issue-12892.js +```diff +-setTimeout( +- () => { +- console.log("test"); +- }, +- someFunctionCall( +- veryLongParameterName1, +- veryLongParameterName2, +- veryLongParameterName3, +- veryLongParameterName4, +- ), +-); ++setTimeout(() => { ++ console.log("test"); ++}, someFunctionCall( ++ veryLongParameterName1, ++ veryLongParameterName2, ++ veryLongParameterName3, ++ veryLongParameterName4, ++)); + +``` + +**Prettier Similarity**: 0.00% + + +# js/call/first-argument-expansion/issue-13237.js + +**Prettier Similarity**: 100.00% + + +# js/call/first-argument-expansion/issue-14454.js + +**Prettier Similarity**: 100.00% + + +# js/call/first-argument-expansion/issue-2456.js +```diff +-f( +- (x) => { +- y; +- }, +- err.message.includes("asd") && +- err.message.includes("id") && +- err.message.includes('"1"') && +- err.message.includes("Model") && +- err.message.includes("/id") && +- err.message.includes("identifier(number)"), +-); ++f((x) => { ++ y; ++}, err.message.includes("asd") && ++ err.message.includes("id") && ++ err.message.includes('"1"') && ++ err.message.includes("Model") && ++ err.message.includes("/id") && ++ err.message.includes("identifier(number)")); + +``` + +**Prettier Similarity**: 0.00% + + +# js/call/first-argument-expansion/issue-4401.js +```diff + export function test() { +- setTimeout( +- () => { +- console.warn({}, "Lambda approaching timeout."); +- }, +- Math.max(context.getRemainingTimeInMillis() - WARN_TIMEOUT_MS, 0), +- ); ++ setTimeout(() => { ++ console.warn({}, "Lambda approaching timeout."); ++ }, Math.max(context.getRemainingTimeInMillis() - WARN_TIMEOUT_MS, 0)); + } + +``` + +**Prettier Similarity**: 25.00% + + +# js/call/first-argument-expansion/issue-5172.js +```diff +-call( +- function () { +- return 1; +- }, ++call(function () { ++ return 1; ++}, $var ?? ++ $var ?? ++ $var ?? ++ $var ?? ++ $var ?? ++ $var ?? ++ $var ?? + $var ?? +- $var ?? +- $var ?? +- $var ?? +- $var ?? +- $var ?? +- $var ?? +- $var ?? +- $var ?? +- "test", +-); ++ $var ?? ++ "test"); + +-call( +- function () { +- return 1; +- }, +- $var || +- ($var ?? $var ?? $var ?? $var ?? $var ?? $var ?? $var ?? $var ?? "test"), +-); ++call(function () { ++ return 1; ++}, $var || ++ ($var ?? $var ?? $var ?? $var ?? $var ?? $var ?? $var ?? $var ?? "test")); + +``` + +**Prettier Similarity**: 8.70% + + +# js/call/first-argument-expansion/jsx.js + +**Prettier Similarity**: 100.00% + + +# js/call/first-argument-expansion/test.js + +**Prettier Similarity**: 100.00% + + +# js/call/no-argument/special-cases.js + +**Prettier Similarity**: 100.00% + + +# js/chain-expression/test.js +```diff +-(a?.b).c; +-(a?.()).b; ++a?.b.c; ++a?.().b; + +-(a?.b)(); +-(a?.())(); ++a?.b(); ++a?.()(); + + new (a?.b)(); + new (a?.())(); + +``` + +**Prettier Similarity**: 50.00% + + +# js/class-comment/class-property.js + +**Prettier Similarity**: 100.00% + + +# js/class-comment/misc.js + +**Prettier Similarity**: 100.00% + + +# js/class-comment/superclass.js + +**Prettier Similarity**: 100.00% + + +# js/class-extends/complex.js + +**Prettier Similarity**: 100.00% + + +# js/class-extends/extends.js + +**Prettier Similarity**: 100.00% + + +# js/class-static-block/class-static-block.js + +**Prettier Similarity**: 100.00% + + +# js/class-static-block/with-line-breaks.js + +**Prettier Similarity**: 100.00% + + +# js/classes-private-fields/optional-chaining.js + +**Prettier Similarity**: 100.00% + + +# js/classes-private-fields/private_fields.js + +**Prettier Similarity**: 100.00% + + +# js/classes-private-fields/with_comments.js + +**Prettier Similarity**: 100.00% + + +# js/classes/asi.js + +**Prettier Similarity**: 100.00% + + +# js/classes/assignment.js + +**Prettier Similarity**: 100.00% + + +# js/classes/binary.js + +**Prettier Similarity**: 100.00% + + +# js/classes/call.js + +**Prettier Similarity**: 100.00% + + +# js/classes/class-fields-features.js + +**Prettier Similarity**: 100.00% + + +# js/classes/empty.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/async.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/computed.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/get.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/private.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/set.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/static-async.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/static-get.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/static-set.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/static-static.js + +**Prettier Similarity**: 100.00% + + +# js/classes/keyword-property/static.js + +**Prettier Similarity**: 100.00% + + +# js/classes/member.js + +**Prettier Similarity**: 100.00% + + +# js/classes/method.js + +**Prettier Similarity**: 100.00% + + +# js/classes/new.js + +**Prettier Similarity**: 100.00% + + +# js/classes/property.js + +**Prettier Similarity**: 100.00% + + +# js/classes/super.js + +**Prettier Similarity**: 100.00% + + +# js/classes/ternary.js + +**Prettier Similarity**: 100.00% + + +# js/classes/top-level-super/example.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/binary-expr.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/closure-compiler-type-cast.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/comment-in-the-middle.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/comment-placement.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/extra-spaces-and-asterisks.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/iife-issue-5850-isolated.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/iife.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/issue-4124.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/issue-8045.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/issue-9358.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/member.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/nested.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/non-casts.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/object-with-comment.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/satisfies.js +```diff +-module.exports = /** @satisfies {Record} */ ({ ++module.exports = /** @satisfies {Record} */ { + hello: 1337, +-}); ++}; + +``` + +**Prettier Similarity**: 33.33% + + +# js/comments-closure-typecast/styled-components.js +```diff + const OverlapWrapper = + /** @type {import('styled-components').ThemedStyledFunction<'div',null,{overlap: boolean}>} */ + (styled.div)` +- position: relative; ++position:relative; + > { +- position: absolute; +- bottom: ${(p) => p.overlap === "previous" && 0}; +- top: ${(p) => p.overlap === "next" && 0}; +- } +- `; ++ position: absolute; ++ bottom: ${(p) => p.overlap === "previous" && 0}; ++top: ${(p) => p.overlap === "next" && 0}; ++} ++`; + +``` + +**Prettier Similarity**: 40.00% + + +# js/comments-closure-typecast/superclass.js + +**Prettier Similarity**: 100.00% + + +# js/comments-closure-typecast/ways-to-specify-type.js + +**Prettier Similarity**: 100.00% + + +# js/comments/arrow.js + +**Prettier Similarity**: 100.00% + + +# js/comments/assignment-pattern.js + +**Prettier Similarity**: 100.00% + + +# js/comments/before-comma.js + +**Prettier Similarity**: 100.00% + + +# js/comments/binary-expressions-block-comments.js + +**Prettier Similarity**: 100.00% + + +# js/comments/binary-expressions-parens.js + +**Prettier Similarity**: 100.00% + + +# js/comments/binary-expressions-single-comments.js + +**Prettier Similarity**: 100.00% + + +# js/comments/binary-expressions.js + +**Prettier Similarity**: 100.00% + + +# js/comments/blank.js + +**Prettier Similarity**: 100.00% + + +# js/comments/break-continue-statements.js +```diff + for (;;) { + break; /* comment */ + continue; /* comment */ + } + + loop: for (;;) { +- break /* comment */ loop; +- break loop /* comment */; +- continue /* comment */ loop; +- continue loop /* comment */; ++ break loop; /* comment */ ++ break loop; /* comment */ ++ continue loop; /* comment */ ++ continue loop; /* comment */ + } + +``` + +**Prettier Similarity**: 63.64% + + +# js/comments/call_comment.js + +**Prettier Similarity**: 100.00% + + +# js/comments/class.js + +**Prettier Similarity**: 100.00% + + +# js/comments/dangling.js + +**Prettier Similarity**: 100.00% + + +# js/comments/dangling_array.js + +**Prettier Similarity**: 100.00% + + +# js/comments/dangling_for.js + +**Prettier Similarity**: 100.00% + + +# js/comments/dynamic_imports.js + +**Prettier Similarity**: 100.00% + + +# js/comments/emoji.js + +**Prettier Similarity**: 100.00% + + +# js/comments/empty-statements.js +```diff +-a; /* a */ // b +-/* c */ +-foo; // first +-// second +-// third +-function x() {} // first +-// second ++a; /* a */ /* c */ // b ++ ++foo; // first // second // third ++ ++function x() {} // first // second ++ + a = +- b + // 1 +- // 2 +- c + // 3 +- // 4 +- d + // 5 +- /* 6 */ ++ b + // 1 // 2 ++ c + // 3 // 4 ++ d /* 6 */ + // 5 + e; // 7 + +``` + +**Prettier Similarity**: 13.33% + + +# js/comments/export-and-import.js + +**Prettier Similarity**: 100.00% + + +# js/comments/export.js +```diff + export //comment +- {}; ++{}; + + export /* comment */ {}; + + const foo = ""; + export { + foo, // comment + }; + + const bar = ""; + export { + // comment + bar, + }; + + const fooo = ""; + const barr = ""; + export { + fooo, // comment + barr, // comment + }; + + const foooo = ""; + const barrr = ""; + export { + foooo, + // comment + barrr as baz, + } from "foo"; + + const fooooo = ""; + const barrrr = ""; + export { + fooooo, + // comment + barrrr as bazz, + }; + +``` + +**Prettier Similarity**: 97.37% + + +# js/comments/first-line.js + +**Prettier Similarity**: 100.00% + + +# js/comments/flow-types/inline.js + +**Prettier Similarity**: 100.00% + + +# js/comments/function-declaration.js + +**Prettier Similarity**: 100.00% + + +# js/comments/function/between-parentheses-and-function-body.js +```diff + function function_declaration() { + // this is a function + return 42; + } + +-(function named() { +- // this is a function +- return 42; +-})(); ++// FIXME ++// TODO: reformat issue ++// (function named() ++// // this is a function ++// { ++// return 42 ++// })(); + +-(function () { +- // this is a function +- return 42; +-})(); ++// FIXME ++// TODO: reformat issue ++// (function () ++// // this is a function ++// { ++// return 42 ++// })(); + + /* anonymous declaration */ + export default function () { + // this is a function + return 42; + } + ++// FIXME ++// TODO: reformat issue + a = { + foo() { + // this is a function + }, + +- bar: function () { +- // this is a function +- }, ++ // bar: function() ++ // // this is a function ++ // {}, + }; + +``` + +**Prettier Similarity**: 50.00% + + +# js/comments/html-like/comment.js +```diff + + +``` + +**Prettier Similarity**: 66.67% + + +# js/comments/if.js + +**Prettier Similarity**: 100.00% + + +# js/comments/issue-3532.js + +**Prettier Similarity**: 100.00% + + +# js/comments/issues.js + +**Prettier Similarity**: 100.00% + + +# js/comments/jsdoc-nestled-dangling.js +```diff + { + { + { + { + { + { + { + o = { + /** + * A +- *//** ++ */ ++ /** + * B + */ + }; + } + } + } + } + } + } + } + +``` + +**Prettier Similarity**: 90.91% + + +# js/comments/jsdoc-nestled.js +```diff + const issues = { + see: "#7724 and #12653", +- /** Trailing comment 1 (not nestled as both comments should be multiline for that) */ /** ++ /** Trailing comment 1 (not nestled as both comments should be multiline for that) */ ++ /** + * Trailing comment 2 + */ + }; + + /** + * @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); + } + } + + /** Trailing nestled comment 1 +- *//** Trailing nestled comment 2 +- *//** Trailing nestled comment 3 + */ ++/** Trailing nestled comment 2 ++ */ ++/** Trailing nestled comment 3 ++ */ + +``` + +**Prettier Similarity**: 77.42% + + +# js/comments/jsdoc.js + +**Prettier Similarity**: 100.00% + + +# js/comments/jsx.js + +**Prettier Similarity**: 100.00% + + +# js/comments/last-arg.js + +**Prettier Similarity**: 100.00% + + +# js/comments/multi-comments-2.js + +**Prettier Similarity**: 100.00% + + +# js/comments/multi-comments-on-same-line-2.js + +**Prettier Similarity**: 100.00% + + +# js/comments/multi-comments-on-same-line.js +```diff + /*========= All on same line =========*/ + a; + /*1*/ /*2*/ /*3*/ + b; + + a; /*1*/ /*2*/ /*3*/ + b; + + a; + /*1*/ /*2*/ /*3*/ b; + + a; + /* + 1*/ /*2*/ /*3 + */ + b; + + a; /* + 1*/ /*2*/ /*3 + */ + b; + +-a; +-/* ++a; /* + 1*/ /*2*/ /*3 +- */ b; ++ */ ++b; + + /*========= First two on same line =========*/ + a; + /*1*/ /*2*/ + /*3*/ + b; + + a; /*1*/ /*2*/ + /*3*/ + b; + + a; + /*1*/ /*2*/ + /*3*/ b; + + a; + /* + 1*/ /*2*/ + /*3 + */ + b; + + a; /* + 1*/ /*2*/ + /*3 + */ + b; + + a; /* + 1*/ /*2*/ + /*3 + */ b; + + /*========= Last two on same line =========*/ + a; + /*1*/ + /*2*/ /*3*/ + b; + + a; /*1*/ + /*2*/ /*3*/ + b; + + a; + /*1*/ + /*2*/ /*3*/ b; + + a; + /* + 1*/ + /*2*/ /*3 + */ + b; + + a; /* + 1*/ + /*2*/ /*3 + */ + b; + + a; /* + 1*/ + /*2*/ /*3 + */ b; + +``` + +**Prettier Similarity**: 96.67% + + +# js/comments/multi-comments.js + +**Prettier Similarity**: 100.00% + + +# js/comments/preserve-new-line-last.js + +**Prettier Similarity**: 100.00% + + +# js/comments/return-statement.js +```diff + function jsx() { + return ( + // Comment +
+ ); + } + + function unary() { + return ( + // Comment + !!x + ); + } + + function numericLiteralNoParen() { + return 1337; // Comment + } + + function logical() { + return ( + // Reason for 42 + 42 && 84 + ); + } + + function binary() { + return ( + // Reason for 42 + 42 * 84 + ); + } + + function binaryInBinaryLeft() { + return ( + // Reason for 42 + 42 * 84 + 2 + ); + } + + function binaryInBinaryRight() { + return ( + // Reason for 42 + 42 + 84 * 2 + ); + } + + function conditional() { + return ( + // Reason for 42 + 42 ? 1 : 2 + ); + } + + function binaryInConditional() { + return ( + // Reason for 42 + 42 * 3 ? 1 : 2 + ); + } + + function call() { + return ( + // Reason for a + a() + ); + } + + function memberInside() { + return ( + // Reason for a.b + a.b.c + ); + } + + function memberOutside() { + return ( + // Reason for a + a.b.c + ); + } + + function memberInAndOutWithCalls() { +- return aFunction +- .b // Reason for a +- () +- .c.d(); ++ return ( ++ // Reason for a ++ aFunction ++ .b() ++ .c.d() ++ ); + } + + function excessiveEverything() { + return ( + // Reason for stuff + a.b() * 3 + 4 ? ((a`hi`, 1) ? 1 : 1) : 1 + ); + } + + // See https://github.com/prettier/prettier/issues/2392 + // function sequenceExpression() { + // return ( + // // Reason for a + // a + // ), b + // } + + function sequenceExpressionInside() { + return ( + // Reason for a + a, b + ); + } + + function taggedTemplate() { + return ( + // Reason for a + a`b` + ); + } + + function inlineComment() { + return /* hi */ 42 || 42; + } + +-function multilineBlockSameLine() { +- return ( +- /** +- * @type {string} +- */ "result" +- ); +-} ++// TODO: fix idempotency issue ++// function multilineBlockSameLine() { ++// return ( ++// /** ++// * @type {string} ++// */ 'result' ++// ) ++// } + + function multilineBlockNextLine() { + return ( + /** + * @type {string} + */ + "result" + ); + } + + function multilineBlockSameLineJsx() { + return ( + /** + * JSX Same line + */
+ ); + } + + function multilineBlockNextLineJsx() { + return ( + /** + * JSX Next line + */ +
+ ); + } + + function singleLineBlockSameLine() { + return /** Result -> */ "result"; + } + + function singleLineBlockNextLine() { + return ( + /** Result below */ + "result" + ); + } + +``` + +**Prettier Similarity**: 91.67% + + +# js/comments/single-star-jsdoc.js + +**Prettier Similarity**: 100.00% + + +# js/comments/switch.js + +**Prettier Similarity**: 100.00% + + +# js/comments/tagged-template-literal.js +```diff + foo``; // comment + + foo // comment + ``; + + foo // comment + ` + `; + +-foo/* comment */ ` ++foo /* comment */` + `; + +-foo/* comment */ ` ++foo /* comment */` + `; + +``` + +**Prettier Similarity**: 85.71% + + +# js/comments/template-literal.js + +**Prettier Similarity**: 100.00% + + +# js/comments/trailing-jsdocs.js +```diff + const CONNECTION_STATUS = (exports.CONNECTION_STATUS = { + CLOSED: Object.freeze({ kind: "CLOSED" }), + CONNECTED: Object.freeze({ kind: "CONNECTED" }), + CONNECTING: Object.freeze({ kind: "CONNECTING" }), + NOT_CONNECTED: Object.freeze({ kind: "NOT_CONNECTED" }), + }); + +-/* A comment */ /** ++/* A comment */ ++/** + * A type that can be written to a buffer. +- */ /** ++ */ ++/** + * Describes the connection status of a ReactiveSocket/DuplexConnection. + * - NOT_CONNECTED: no connection established or pending. + * - CONNECTING: when `connect()` has been called but a connection is not yet + * established. + * - CONNECTED: when a connection is established. + * - CLOSED: when the connection has been explicitly closed via `close()`. + * - ERROR: when the connection has been closed for any other reason. +- */ /** ++ */ ++/** + * A contract providing different interaction models per the [ReactiveSocket protocol] + * (https://github.com/ReactiveSocket/reactivesocket/blob/master/Protocol.md). +- */ /** ++ */ ++/** + * A single unit of data exchanged between the peers of a `ReactiveSocket`. + */ + +``` + +**Prettier Similarity**: 70.37% + + +# js/comments/trailing_space.js +```diff +-#!/there/is-space-here-> ++#!/there/is-space-here-> + + // Do not trim trailing whitespace from this source file! + + // There is some space here -> + +``` + +**Prettier Similarity**: 80.00% + + +# js/comments/try.js + +**Prettier Similarity**: 100.00% + + +# js/comments/variable_declarator.js + +**Prettier Similarity**: 100.00% + + +# js/comments/while.js + +**Prettier Similarity**: 100.00% + + +# js/computed-props/classes.js + +**Prettier Similarity**: 100.00% + + +# js/conditional/comments.js +```diff + var inspect = + 4 === util.inspect.length + ? // node <= 0.8.x + function (v, colors) { + return util.inspect(v, void 0, void 0, colors); + } + : // node > 0.8.x + function (v, colors) { + return util.inspect(v, { colors: colors }); + }; + + var inspect = + 4 === util.inspect.length + ? // node <= 0.8.x + function (v, colors) { + return util.inspect(v, void 0, void 0, colors); + } + : // node > 0.8.x + function (v, colors) { + return util.inspect(v, { colors: colors }); + }; + + const extractTextPluginOptions = shouldUseRelativeAssetPaths + ? // Making sure that the publicPath goes back to to build folder. + { publicPath: Array(cssFilename.split("/").length).join("../") } + : {}; + + const extractTextPluginOptions2 = shouldUseRelativeAssetPaths + ? // Making sure that the publicPath goes back to to build folder. + { publicPath: Array(cssFilename.split("/").length).join("../") } + : {}; + + const extractTextPluginOptions3 = shouldUseRelativeAssetPaths // Making sure that the publicPath goes back to to build folder. + ? { publicPath: Array(cssFilename.split("/").length).join("../") } + : {}; + + const { configureStore } = + process.env.NODE_ENV === "production" + ? require("./configureProdStore") // a + : require("./configureDevStore"); // b + + test /* comment + comment + comment + */ + ? foo + : bar; + + test + ? /* comment + comment + comment + comment + */ + foo + : bar; + + test + ? /* comment + comment + comment + comment + */ + foo + : test + ? /* comment + comment + comment */ + foo + : bar; + + test ? /* comment */ foo : bar; + + test + ? foo + : /* comment + comment + comment + comment + */ + bar; + + test + ? foo + : /* comment + comment + comment + comment + A newline will be added after this comment, unfortunately – but it can be removed manually, see next statement. + */ + test + ? foo + : /* comment + comment + comment + */ + bar; + + // It is at least possible to delete the extra newline that was + // unfortunately added before the second condition above: + test +- ? foo /* comment ++ ? foo ++ : /* comment + comment + comment + comment + */ +- : test ++ test + ? foo + : /* comment + comment + comment + */ + bar; + + test ? foo : /* comment */ bar; + + test + ? test /* c + c */ + ? foo + : bar + : bar; + +``` + +**Prettier Similarity**: 97.56% + + +# js/conditional/new-expression.js + +**Prettier Similarity**: 100.00% + + +# js/conditional/new-ternary-examples.js + +**Prettier Similarity**: 100.00% + + +# js/conditional/new-ternary-spec.js + +**Prettier Similarity**: 100.00% + + +# js/conditional/no-confusing-arrow.js + +**Prettier Similarity**: 100.00% + + +# js/conditional/postfix-ternary-regressions.js +```diff + // concatened string in consequent should be visually distinguishable from alternate + // … or maybe this is okay, because the colon is enough? + const avatar = has_ordered + ? "https://marmelab.com/posters/avatar/longer-word-that-breaks-consequent-" + + numberOfCustomers + + ".jpeg" + : undefined; + + // Similarly, in the alternate: + const redirectUrl = pathName + ? pathName + : nextPathName + nextSearch || + defaultAuthParams.afterLoginUrl.makeThisLongerSoItBreaks; + + // And another, more pathological case of the above: + const isEmpty = (obj) => + obj instanceof Date + ? false + : obj === "" || + obj === null || + obj === undefined || + obj === somethingThatIsLonger || + shallowEqual(obj, {}); + + // Again, this case is a bit hard to distinguish the alternate. + const eventsFromOrders = + orderIds && orders + ? orderIds.map((id) => ({ + type: "order", + date: orders[id].date, + data: orders[id], + })) + : []; + + // Kinda weird to have dedents to the level of "return" in a function. + function foo() { + return !linkTo + ? false + : typeof linkTo === "function" + ? linkTo(record, reference) + : linkToRecord(rootPath, sourceId, linkTo_as_string); + } + function foo2() { + return React.isValidElement(emptyText) + ? React.cloneElement(emptyText) + : emptyText === "" + ? " " // em space, forces the display of an empty line of normal height + : translate(emptyText, { _: emptyText }); + } + + // Function call ideally wouldnt break break + const matchingReferencesError = isMatchingReferencesError(matchingReferences) + ? translate(matchingReferences.error, { + _: matchingReferences.error, + }) + : null; + + // This one is kinda confusing any way you slice it… + const obj = { + error: + matchingReferencesError && + (!input.value || + (input.value && selectedReferencesDataStatus === REFERENCES_STATUS_EMPTY)) + ? translate("ra.input.references.all_missing", { + _: "ra.input.references.all_missing", + }) + : null, + }; + + // I think we should indent after the inner || on this, and do better wtih the parens around the && + const obj2 = { + warning: + matchingReferencesError || + (input.value && selectedReferencesDataStatus !== REFERENCES_STATUS_READY) + ? matchingReferencesError || + translate("ra.input.references.many_missing", { + _: "ra.input.references.many_missing", + }) + : null, + }; + + // The boolean conditions in the test should look cohesive. + const selectedReferencesDataStatus = + !isEmpty(value) && typeof value === "string" && !pattern.test(value) + ? getMessage(message, { pattern }, value, values) + : undefined; + + // Would be nice if these two nested ternaries didn't look like a single one. + resolveRedirectTo( + redirectTo, + basePath, + payload + ? payload.id || (payload.data ? payload.data.id : null) + : requestPayload + ? requestPayload.id + : null, + payload && payload.data + ? payload.data + : requestPayload && requestPayload.data + ? requestPayload.data + : null, + ); + + const delayedDataProvider = new Proxy(restProvider, { + get: (target, name, self) => +- name === "then" // as we await for the dataProvider, JS calls then on it. We must trap that call or else the dataProvider will be called with the then method +- ? self ++ name === "then" ++ ? // as we await for the dataProvider, JS calls then on it. We must trap that call or else the dataProvider will be called with the then method ++ self + : (resource, params) => + new Promise((resolve) => + setTimeout( + () => resolve(restProvider[name](resource, params)), + 500, + ), + ), + }); + + function foo4() { + return !match || match.length < 5 + ? line + : match[1] + match[2] + match[3] + match[4]; + } + + function foo5() { + return !match || match.length < 5 + ? foo(line) + : match[1] + match[2] + match[3] + match[4]; + } + + function foo6() { + return !match || match.length < 5 + ? linethatisverylongandbreaksthelinehooray + : match[1] + match[2] + match[3] + match[4]; + } + + function foo7() { + return !match || match.length < 5 + ? linethatisverylongandbreaksthelinehoorayjustabitlonger + : match[1] + match[2] + match[3] + match[4]; + } + + const badComments = schema.model + ? schema + : // If model is an array where the items schema is a referred model then we need to use that + schema.type === "array" + ? schema.items + : schema; + + const anotherBadComment = refModel + ? // If we're in a shared params file then reference the model name directly + inSharedParamsFile + ? refModel + : // If we're not in a shared params file then reference the in-file type + classRef() + : // We don't have a model name, use the in-file name + classRef(); + +``` + +**Prettier Similarity**: 98.08% + + +# js/cursor/comments-1.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/comments-2.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/comments-3.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/comments-4.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-0.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-1.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-10.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-2.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-3.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-4.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-5.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-6.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-7.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-8.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-9.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/cursor-emoji.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/file-start-with-comment-1.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/file-start-with-comment-2.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/file-start-with-comment-3.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-0.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-1.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-2.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-3.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-4.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-5.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-6.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-7.js + +**Prettier Similarity**: 100.00% + + +# js/cursor/range-8.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/basic.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/comments.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/computed.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/not-accessor-method.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/not-accessor-property.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/private.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/static-computed.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/static-private.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/static.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/with-semicolon-1.js + +**Prettier Similarity**: 100.00% + + +# js/decorator-auto-accessors/with-semicolon-2.js + +**Prettier Similarity**: 100.00% + + +# js/decorators-export/after_export.js + +**Prettier Similarity**: 100.00% + + +# js/decorators-export/before_export.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/class-expression/arguments.js +```diff + console.log( +- @deco +- class Foo {}, ++ ( ++ @deco ++ class Foo {} ++ ), + ); + console.log( +- @deco +- class {}, ++ ( ++ @deco ++ class {} ++ ), + ); + +``` + +**Prettier Similarity**: 33.33% + + +# js/decorators/class-expression/class-expression.js +```diff + const a1 = +- @deco +- class Foo {}; ++ ( ++ @deco ++ class Foo {} ++ ); + const a2 = +- @deco +- class {}; ++ ( ++ @deco ++ class {} ++ ); + + ( + @deco + class Foo {} + ); + ( + @deco + class {} + ); + + const b1 = []; + ( + @deco + class Foo {} + ); + + const b2 = []; + ( + @deco + class {} + ); + + // This is not a `ClassExpression` but `ClassDeclaration` + @deco + class Foo {} + +``` + +**Prettier Similarity**: 77.14% + + +# js/decorators/class-expression/member-expression.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/class-expression/super-class.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/classes.js +```diff + @deco + class Foo {} + + @deco + export class Bar {} + + @deco + export default class Baz {} + + const foo = +- @deco +- class { +- // +- }; ++ ( ++ @deco ++ class { ++ // ++ } ++ ); + + const bar = +- @deco +- class { +- // +- }; ++ ( ++ @deco ++ class { ++ // ++ } ++ ); + +``` + +**Prettier Similarity**: 50.00% + + +# js/decorators/comments.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/member-expression.js +```diff + [ + class { + @(decorators[0]) + method() {} + }, + class { + @decorators [0]; + method() {} + }, + class { + @(decorators?.[0]) + method() {} + }, + class { +- @decorators.at(0) ++ @(decorators.at(0)) + method() {} + }, + class { + @(decorators?.at(0)) + method() {} + }, + class { +- @decorators.first ++ @(decorators.first) + method() {} + }, + class { + @(decorators?.first) + method() {} + }, + class { + @(decorators[first]) + method() {} + }, + class { + @decorators [first]; + method() {} + }, + class { + @(decorators["first"]) + method() {} + }, +- @(decorators[first]) +- class { +- method() {} +- }, +- @(decorators[0]) +- class { +- method() {} +- }, ++ ( ++ @(decorators[first]) ++ class { ++ method() {} ++ } ++ ), ++ ( ++ @(decorators[0]) ++ class { ++ method() {} ++ } ++ ), + ]; + +``` + +**Prettier Similarity**: 74.07% + + +# js/decorators/methods.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/mixed.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/mobx.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/multiline.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/multiple.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/parens.js + +**Prettier Similarity**: 100.00% + + +# js/decorators/redux.js + +**Prettier Similarity**: 100.00% + + +# js/deferred-import-evaluation/import-defer-attributes-declaration.js +```diff +-import defer * as ns from "x" with { attr: "val" }; ++import defer ++* as ns from "x" ++with { attr: "val" } + +``` + +**Prettier Similarity**: 0.00% + + +# js/deferred-import-evaluation/import-defer.js +```diff +-import defer * as ns from "x"; ++import defer ++* as ns from "x" + +``` + +**Prettier Similarity**: 0.00% + + +# js/destructuring-ignore/ignore.js + +**Prettier Similarity**: 100.00% + + +# js/destructuring/destructuring.js +```diff + const [one, two = null, three = null] = arr; + a = ([s = 1]) => 1; + const { children, ...props } = this.props; + + const { + user: { firstName, lastName }, + } = this.props; + + const { + name: { first, last }, + organisation: { + address: { street: orgStreetAddress, postcode: orgPostcode }, + }, + } = user; + + function f({ data: { name } }) {} + + const UserComponent = function ({ + name: { first, last }, + organisation: { + address: { street: orgStreetAddress, postcode: orgPostcode }, + }, + }) { + return; + }; + + const { + a, + b, + c, + d: { e }, + } = someObject; + + try { + // code + } catch ({ data: { message } }) { + // code + } + + try { + // code +-} catch ({ +- data: { +- message: { errors }, +- }, +-}) { ++} catch ({ data: { message: { errors } } }) { + // code + } + + const obj = { + func(id, { blog: { title } }) { + return id + title; + }, + }; + + class A { + func(id, { blog: { title } }) { + return id + title; + } + } + +``` + +**Prettier Similarity**: 91.67% + + +# js/destructuring/issue-5988.js + +**Prettier Similarity**: 100.00% + + +# js/directives/escaped.js + +**Prettier Similarity**: 100.00% + + +# js/directives/issue-7346.js + +**Prettier Similarity**: 100.00% + + +# js/directives/last-line-0.js + +**Prettier Similarity**: 100.00% + + +# js/directives/last-line-1.js + +**Prettier Similarity**: 100.00% + + +# js/directives/last-line-2.js + +**Prettier Similarity**: 100.00% + + +# js/directives/newline.js + +**Prettier Similarity**: 100.00% + + +# js/directives/no-newline.js + +**Prettier Similarity**: 100.00% + + +# js/directives/test.js + +**Prettier Similarity**: 100.00% + + +# js/dynamic-import/assertions.js + +**Prettier Similarity**: 100.00% + + +# js/dynamic-import/test.js + +**Prettier Similarity**: 100.00% + + +# js/empty-paren-comment/class-property.js + +**Prettier Similarity**: 100.00% + + +# js/empty-paren-comment/class.js + +**Prettier Similarity**: 100.00% + + +# js/empty-paren-comment/empty_paren_comment.js + +**Prettier Similarity**: 100.00% + + +# js/empty-statement/body.js + +**Prettier Similarity**: 100.00% + + +# js/empty-statement/no-newline.js + +**Prettier Similarity**: 100.00% + + +# js/end-of-line/example.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_arrow_expression.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_call_expression.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_class_declaration.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_class_expression.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_function_declaration.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_function_declaration_async.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_function_declaration_named.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_function_expression.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_function_expression_named.js + +**Prettier Similarity**: 100.00% + + +# js/es6modules/export_default_new_expression.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/for-await-using-of-comments.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/invalid-duplicate-using-bindings.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/invalid-script-top-level-using-binding.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/using-declarations.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-await-expr-using-in.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-await-expr-using-instanceof.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-await-expr-using.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-await-using-asi-assignment.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-await-using-binding-basic.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-await-using-binding-escaped.js +```diff + async function f() { +- await using ab = c; ++ await using \u0061b = c; + } + +``` + +**Prettier Similarity**: 66.67% + + +# js/explicit-resource-management/valid-await-using-binding-non-bmp.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-await-using-binding-using.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-await-using-comments.js +```diff + async function f() { + { +- /*0*/ await using /*1*/ /*2*/ b /*3*/ = /*4*/ f(); /*5*/ ++ /*0*/ await using /*1*/ /*2*/ b /*3*/ = /*4*/ f() /*5*/; + } + { + /*0*/ for ( + /*1*/ /*2*/ await using /*3*/ /*4*/ b /*5*/ = + /*6*/ x /*7*/ /*8*/ /*9*/ /*10*/; + ; +- + ); + } + { + /*0*/ for (/*1*/ /*2*/ await using /*3*/ /*4*/ b /*5*/ of /*6*/ x /*7*/ /*8*/); + } + { + /*0*/ for await (/*1*/ /*2*/ /*3*/ await using /*4*/ /*5*/ b /*6*/ of /*7*/ x /*8*/ /*9*/); + } + } + +``` + +**Prettier Similarity**: 89.47% + + +# js/explicit-resource-management/valid-for-await-using-binding-escaped-of-of.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-for-using-binding-escaped-of-of.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-for-using-binding-of-of.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-for-using-declaration.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-module-block-top-level-await-using-binding.js +```diff +-const m = module { ++const m = module; ++{ + await using foo = bar(); +-}; ++} + +``` + +**Prettier Similarity**: 25.00% + + +# js/explicit-resource-management/valid-module-block-top-level-using-binding.js +```diff +-module { ++module; ++{ + using foo = bar(); +-}; ++} + +``` + +**Prettier Similarity**: 25.00% + + +# js/explicit-resource-management/valid-using-as-identifier-computed-member.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-as-identifier-expression-statement.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-as-identifier-for-await-of.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-as-identifier-for-in.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-as-identifier-for-init.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-as-identifier-for-of.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-as-identifier-in.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-binding-basic.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-binding-escaped.js +```diff + { +- using ab = c; ++ using \u0061b = c; + } + +``` + +**Prettier Similarity**: 66.67% + + +# js/explicit-resource-management/valid-using-binding-non-bmp.js + +**Prettier Similarity**: 100.00% + + +# js/explicit-resource-management/valid-using-binding-using.js + +**Prettier Similarity**: 100.00% + + +# js/export-default/binary_and_template.js +```diff +-export default (function () {} + foo)``; ++export default ((function () {}) + foo)``; + +``` + +**Prettier Similarity**: 0.00% + + +# js/export-default/body.js +```diff +-export default (class {}[1] = 1); ++export default ((class {})[1] = 1); + +``` + +**Prettier Similarity**: 0.00% + + +# js/export-default/class_instance.js +```diff +-export default (class {}.getInstance()); ++export default (class {}).getInstance(); + +``` + +**Prettier Similarity**: 0.00% + + +# js/export-default/escaped/default-escaped.js +```diff + // export asyn\u{63} from "async"; +-export nc from "async"; ++export ++n\u{63}; ++from; ++("async"); + +``` + +**Prettier Similarity**: 20.00% + + +# js/export-default/function_in_template.js + +**Prettier Similarity**: 100.00% + + +# js/export-default/function_tostring.js +```diff +-export default (function () {}.toString()); ++export default (function () {}).toString(); + +``` + +**Prettier Similarity**: 0.00% + + +# js/export-default/iife.js + +**Prettier Similarity**: 100.00% + + +# js/export-star/export-star-as-default.js + +**Prettier Similarity**: 100.00% + + +# js/export-star/export-star-as-reserved-word.js + +**Prettier Similarity**: 100.00% + + +# js/export-star/export-star-as-string.js + +**Prettier Similarity**: 100.00% + + +# js/export-star/export-star-as-string2.js + +**Prettier Similarity**: 100.00% + + +# js/export-star/export-star-as.js + +**Prettier Similarity**: 100.00% + + +# js/export-star/export-star.js + +**Prettier Similarity**: 100.00% + + +# js/export/blank-line-between-specifiers.js +```diff + export { + // a + foo1, +- + // b + bar1, + baz1, + } from "mod"; + + const foo2 = 1; + const bar2 = 1; + const baz2 = 1; + + export { + // a + foo2, +- + // b + bar2, + baz2, + }; + +``` + +**Prettier Similarity**: 90.48% + + +# js/export/bracket.js + +**Prettier Similarity**: 100.00% + + +# js/export/empty.js + +**Prettier Similarity**: 100.00% + + +# js/export/same-local-and-exported.js + +**Prettier Similarity**: 100.00% + + +# js/export/test.js + +**Prettier Similarity**: 100.00% + + +# js/export/undefined.js + +**Prettier Similarity**: 100.00% + + +# js/expression_statement/no_regression.js + +**Prettier Similarity**: 100.00% + + +# js/expression_statement/use_strict.js + +**Prettier Similarity**: 100.00% + + +# js/for-await/for-await.js + +**Prettier Similarity**: 100.00% + + +# js/for-of/async-identifier.js + +**Prettier Similarity**: 100.00% + + +# js/for/comment.js + +**Prettier Similarity**: 100.00% + + +# js/for/continue-and-break-comment-1.js +```diff + for (;;) { + continue; // comment + } + + for (;;) { + break; // comment + } + + for (const f of []) { + continue; // comment + } + + for (const f of []) { + break; // comment + } + + for (const f in {}) { + continue; // comment + } + + for (const f in {}) { + break; // comment + } + + while (true) { + continue; // comment + } + + while (true) { + break; // comment + } + + do { + continue; // comment + } while (true); + + do { + break; // comment + } while (true); + + label1: for (;;) { + continue label1; // comment + } + + label2: { + break label2; // comment + } + + for (;;) { + continue; /* comment */ + } + + for (;;) { + break; /* comment */ + } + + for (const f of []) { + continue; /* comment */ + } + + for (const f of []) { + break; /* comment */ + } + + for (const f in {}) { + continue; /* comment */ + } + + for (const f in {}) { + break; /* comment */ + } + + while (true) { + continue; /* comment */ + } + + while (true) { + break; /* comment */ + } + + do { + continue; /* comment */ + } while (true); + + do { + break; /* comment */ + } while (true); + + label1: for (;;) { +- continue label1 /* comment */; ++ continue label1; /* comment */ + } + + label2: { +- break label2 /* comment */; ++ break label2; /* comment */ + } + +``` + +**Prettier Similarity**: 97.89% + + +# js/for/continue-and-break-comment-2.js + +**Prettier Similarity**: 100.00% + + +# js/for/continue-and-break-comment-without-blocks.js +```diff + for (;;) continue; + // comment + + for (;;) break; + // comment + + for (const f of []) continue; + // comment + + for (const f of []) break; + // comment + + for (const f in {}) continue; + // comment + + for (const f in {}) break; + // comment + + for (;;) continue; // comment + + for (;;) break; // comment + + for (const f of []) continue; // comment + + for (const f of []) break; // comment + + for (const f in {}) continue; // comment + + for (const f in {}) break; // comment + + for (;;) continue; /* comment */ + + for (;;) break; /* comment */ + + for (const f of []) continue; /* comment */ + + for (const f of []) break; /* comment */ + + for (const f in {}) continue; /* comment */ + + for (const f in {}) break; /* comment */ + + for (;;) continue; + /* comment */ + + for (;;) break; + /* comment */ + + for (const f of []) continue; + /* comment */ + + for (const f of []) break; + /* comment */ + + for (const f in {}) continue; + /* comment */ + + for (const f in {}) break; + /* comment */ + +-label1: for (;;) continue label1 /* comment */; ++label1: for (;;) continue label1; /* comment */ + + label1: for (;;) continue label1; + /* comment */ + + label1: for (;;) continue label1; // comment + + label1: for (;;) continue label1; + // comment + +``` + +**Prettier Similarity**: 98.55% + + +# js/for/for.js + +**Prettier Similarity**: 100.00% + + +# js/for/in.js + +**Prettier Similarity**: 100.00% + + +# js/for/var.js + +**Prettier Similarity**: 100.00% + + +# js/function-comments/params-trail-comments.js + +**Prettier Similarity**: 100.00% + + +# js/function-first-param/function_expression.js + +**Prettier Similarity**: 100.00% + + +# js/function-single-destructuring/array.js + +**Prettier Similarity**: 100.00% + + +# js/function-single-destructuring/object.js + +**Prettier Similarity**: 100.00% + + +# js/function/function_expression.js + +**Prettier Similarity**: 100.00% + + +# js/function/issue-10277.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/functional_compose.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/gobject_connect.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/lodash_flow.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/lodash_flow_right.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/mongo_connect.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/pipe-function-calls-with-comments.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/pipe-function-calls.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/ramda_compose.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/ramda_pipe.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/redux_compose.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/redux_connect.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/reselect_createselector.js + +**Prettier Similarity**: 100.00% + + +# js/functional-composition/rxjs_pipe.js + +**Prettier Similarity**: 100.00% + + +# js/generator/anonymous.js + +**Prettier Similarity**: 100.00% + + +# js/generator/async.js + +**Prettier Similarity**: 100.00% + + +# js/generator/function-name-starts-with-get.js + +**Prettier Similarity**: 100.00% + + +# js/identifier/for-of/await.js + +**Prettier Similarity**: 100.00% + + +# js/identifier/for-of/let.js +```diff + for ((let) of foo); + for (foo of let); + for (foo of let.a); + for (foo of let[a]); +-for ((let).a of foo); +-for ((let)[a] of foo); ++for (let.a of foo); ++for (let[a] of foo); + for ((let)().a of foo); + for (letFoo of foo); + + for (let.a in foo); +-for ((let)[a] in foo); ++for (let[a] in foo); + + for (let of of let); + +``` + +**Prettier Similarity**: 76.92% + + +# js/identifier/parentheses/const.js +```diff +-const [a = (let[0] = 1)] = 2; ++const [a = ((let)[0] = 1)] = 2; + +``` + +**Prettier Similarity**: 0.00% + + +# js/identifier/parentheses/let.js +```diff + let.a = 1; + + let.a[0] = 1; + +-(let)[a] = 1; ++let[a] = 1; + +-(let)[a].b.c.e = 1; ++let[a].b.c.e = 1; + + foo[let[a]] = 1; + + (let)[let[a]] = 1; + +-(let)[a] ??= 1; ++let[a] ??= 1; + + foo = let[a]; + + let()[a] = 1; + + foo(let)[a] = 1; + + foo(let[a])[a] = 1; + +-(let)[0] = 1; ++let[0] = 1; + +-(let)["a"] = 1; ++let["a"] = 1; + + let = 1; + + var let = 1; + + [let[a]] = 1; + + ({ a: let[a] } = 1); + + alert((let[0] = 1)); + +-((let)[0] = 1) || 2; ++(let[0] = 1) || 2; + +-((let)[0] = 1), 2; ++(let[0] = 1), 2; + +-((let)[0] = 1) ? a : b; ++(let[0] = 1) ? a : b; + + if ((let[0] = 1)); + + while ((let[0] = 1)); + + do {} while ((let[0] = 1)); + + var a = (let[0] = 1); + +-((let)[0] = 1) instanceof a; ++(let[0] = 1) instanceof a; + + void (let[0] = 1); + +-((let)[0] = 1)(); ++(let[0] = 1)(); + + new (let[0] = 1)(); + + ((let)[0] = 1)``; + + ((let)[0] = 1).toString; + + ((let)[0] = 1)?.toString; + + [...(let[0] = 1)]; + + foo = () => (let[0] = 1); + + function* foo() { + yield (let[0] = 1); + } + + async function foo() { + await (let[0] = 1); + } + + function foo() { + return (let[0] = 1); + } + +-while (true) (let)[0] = 1; ++while (true) let[0] = 1; + + throw (let[0] = 1); + + ({ foo: (let[0] = 1) }); + + [(let[0] = 1)]; + +-for ((let)[0] = 1; ; ); ++for (let[0] = 1; ; ); + for ((let)[0] in {}); + for ((let)[0] of []); + + switch ((let[0] = 1)) { + } + + switch (foo) { + case (let[0] = 1): + } + +-with ((let[0] = 1)); ++with (let[0] = 1); + +-(let)[x].foo(); ++let[x].foo(); + + let.let[x].foo(); + + a = let[x].foo(); + + (let)[2]; + + a[1] + (let[2] = 2); + +``` + +**Prettier Similarity**: 87.27% + + +# js/if/comment_before_else.js + +**Prettier Similarity**: 100.00% + + +# js/if/else.js + +**Prettier Similarity**: 100.00% + + +# js/if/expr_and_same_line_comments.js +```diff + if (a === 0) doSomething(); // comment A1 + else if (a === 1) doSomethingElse(); // comment B1 + else if (a === 2) doSomethingElse(); // comment C1 + + if (a === 0) doSomething(); /* comment A2 */ + else if (a === 1) doSomethingElse(); /* comment B2 */ + else if (a === 2) doSomethingElse(); /* comment C2 */ + + if (a === 0) expr; // comment A3 + else if (a === 1) expr; // comment B3 + else if (a === 2) expr; // comment C3 + + if (a === 0) expr; /* comment A4 */ + else if (a === 1) expr; /* comment B4 */ + else if (a === 2) expr; /* comment C4 */ + + if (a === 0) + looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // comment A5 + else if (a === 1) + looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // comment B5 + else if (a === 2) + looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // comment C5 + + function a() { + if (a) return /* comment 6a */; + else return 2; + + if (a) return 1 /* comment 6b */; + else return 2; + + if (a) throw e /* comment 6d */; + else return 2; + + // TODO[@fisker]: fix this + // if (a) var a = 1; /* comment 6e */ + // else return 2; + + if (a) +- if (b /* comment 6f */); ++ if (b);/* comment 6f */ + else return 2; + } + +``` + +**Prettier Similarity**: 97.56% + + +# js/if/if_comments.js + +**Prettier Similarity**: 100.00% + + +# js/if/trailing_comment.js + +**Prettier Similarity**: 100.00% + + +# js/ignore/class-expression-decorator.js +```diff +-// prettier-ignore + ( ++ // prettier-ignore + @decorator + class {} + ); + +``` + +**Prettier Similarity**: 80.00% + + +# js/ignore/decorator.js + +**Prettier Similarity**: 100.00% + + +# js/ignore/ignore-2.js + +**Prettier Similarity**: 100.00% + + +# js/ignore/ignore.js + +**Prettier Similarity**: 100.00% + + +# js/ignore/issue-10661.js + +**Prettier Similarity**: 100.00% + + +# js/ignore/issue-11077.js +```diff + function HelloWorld(x) { +- // prettier-ignore +- // eslint-disable-next-line +- (x.a | +- x.b).call(null); ++ ( ++ // prettier-ignore ++ // eslint-disable-next-line ++ x.a | ++ x.b ++ ).call(null) + } + + function HelloWorld(x) { + // prettier-ignore ++ + ( + // eslint-disable-next-line + x.a | + x.b + ).call(null) + } + +``` + +**Prettier Similarity**: 61.11% + + +# js/ignore/issue-13737.js +```diff + oneArgument( + // prettier-ignore + (0, 1), + ); + + a = +- // prettier-ignore +- (0, 1); ++ ( ++ // prettier-ignore ++ (0, 1) ++); + +``` + +**Prettier Similarity**: 60.00% + + +# js/ignore/issue-14404.js +```diff + async function foo() { +- // prettier-ignore +- // b +- (await thing()).blah; ++ ( ++ // prettier-ignore ++ // b ++ await thing() ++).blah + } + +``` + +**Prettier Similarity**: 28.57% + + +# js/ignore/issue-9335.js + +**Prettier Similarity**: 100.00% + + +# js/ignore/issue-9877.js +```diff + export default function test() { + return { + matrix: // prettier-ignore +- new Float32Array([ +- 0, 0, +- 1, 0, +- 1, 1, +- 0, 1 +- ]), ++ new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), + }; + } + +``` + +**Prettier Similarity**: 45.45% + + +# js/ignore/semi/asi.js + +**Prettier Similarity**: 100.00% + + +# js/ignore/semi/directive.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/bracket-spacing/dynamic-import.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/bracket-spacing/empty.js +```diff +-export * as bar from "bar.json"; ++export * as bar from "bar.json" assert {}; + +``` + +**Prettier Similarity**: 0.00% + + +# js/import-assertions/bracket-spacing/re-export.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/bracket-spacing/static-import.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/dynamic-import.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/empty.js +```diff + export * as foo from "foo.json"; +-export * as bar from "bar.json"; +-export * as baz from "baz.json" /* comment */; ++export * as bar from "bar.json" assert {}; ++export * as baz from "baz.json" assert { /* comment */ }; + + import * as foo from "foo.json"; +-import * as bar from "bar.json"; +-import * as baz from "baz.json" /* comment */; ++import * as bar from "bar.json" assert {}; ++import * as baz from "baz.json" assert { /* comment */ }; + +``` + +**Prettier Similarity**: 42.86% + + +# js/import-assertions/multi-types.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/non-type.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/not-import-assertions.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/re-export.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/static-import.js + +**Prettier Similarity**: 100.00% + + +# js/import-assertions/without-from.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/bracket-spacing/dynamic-import.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/bracket-spacing/empty.js +```diff +-export * as bar from "bar.json"; ++export * as bar from "bar.json" with {}; + +``` + +**Prettier Similarity**: 0.00% + + +# js/import-attributes/bracket-spacing/re-export.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/bracket-spacing/static-import.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/dynamic-import.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/empty.js +```diff + export * as foo from "foo.json"; +-export * as bar from "bar.json"; +-export * as baz from "baz.json" /* comment */; ++export * as bar from "bar.json" with {}; ++export * as baz from "baz.json" with { /* comment */ }; + + import * as foo from "foo.json"; +-import * as bar from "bar.json"; +-import * as baz from "baz.json" /* comment */; ++import * as bar from "bar.json" with {}; ++import * as baz from "baz.json" with { /* comment */ }; + +``` + +**Prettier Similarity**: 42.86% + + +# js/import-attributes/multi-types.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/non-type.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/re-export.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/static-import.js + +**Prettier Similarity**: 100.00% + + +# js/import-attributes/without-from.js + +**Prettier Similarity**: 100.00% + + +# js/import-meta/import_meta.js + +**Prettier Similarity**: 100.00% + + +# js/import-reflection/comments.js +```diff +-/* 0 */ import module /* 1 */ /* 2 */ from /* 3 */ from /* 4 */ "./module.wasm" /* 5 */; ++/* 0 */ import /* 1 */module /* 2 */from /* 3 */ ++from; /* 4 */ ++("./module.wasm") /* 5 */; + +``` + +**Prettier Similarity**: 0.00% + + +# js/import-reflection/import-reflection.js +```diff +-import module foo from "./module.wasm"; ++import module ++foo; ++from; ++("./module.wasm"); + +``` + +**Prettier Similarity**: 0.00% + + +# js/import/brackets.js + +**Prettier Similarity**: 100.00% + + +# js/import/comments.js + +**Prettier Similarity**: 100.00% + + +# js/import/empty-import.js + +**Prettier Similarity**: 100.00% + + +# js/import/inline.js + +**Prettier Similarity**: 100.00% + + +# js/import/long-line.js + +**Prettier Similarity**: 100.00% + + +# js/import/multiple_standalones.js + +**Prettier Similarity**: 100.00% + + +# js/import/same-local-and-imported.js + +**Prettier Similarity**: 100.00% + + +# js/in/arrow-function-invalid.js + +**Prettier Similarity**: 100.00% + + +# js/in/arrow-function.js + +**Prettier Similarity**: 100.00% + + +# js/invalid-code/duplicate_bindings.js + +**Prettier Similarity**: 100.00% + + +# js/label/block-statement-and-regexp.js + +**Prettier Similarity**: 100.00% + + +# js/label/comment.js + +**Prettier Similarity**: 100.00% + + +# js/label/empty_label.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/arrow.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/assignment-pattern.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/break-parent.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/dangling-comment-in-arrow-function.js +```diff +-foo(() => +- // foo +- {}, ++foo( ++ ( ++ // foo ++ ) => {}, + ); + +``` + +**Prettier Similarity**: 20.00% + + +# js/last-argument-expansion/edge_case.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/embed.js +```diff +-foo(/* HTML */ ` +- bar +- `); +-foo(/* HTML */ ` +- +- bar +- +-`); +-foo(/* HTML */ `
+-

bar

+- foo +-
`); +-foo(/* HTML */ ` +-
+-

bar

+- foo +-
+-`); +-foo(/* GraphQL */ ` +- query { +- foo { +- bar +- } +- } +-`); +-foo(/* ... */ css` +- color: magenta; +-`); +-const a = (b) => /* HTML */ ` +- bar +- `; +-const c = (b) => /* HTML */ ` +- +- bar +- +-`; ++foo(/* HTML */ ` bar `); ++foo(/* HTML */ ` bar `); ++foo(/* HTML */ `

bar

foo
`); ++foo(/* HTML */ `

bar

foo
`); ++foo(/* GraphQL */ `query { foo { bar } }`); ++foo(/* ... */ css`color:magenta`); ++const a = (b) => /* HTML */ ` bar `; ++const c = (b) => /* HTML */ ` bar `; + +``` + +**Prettier Similarity**: 0.00% + + +# js/last-argument-expansion/empty-lines.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/empty-object.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/function-body-in-mode-break.js +```diff + fs.readdirSync(suiteLoc).forEach(function (testName) { +- (skip ? it.skip : it)( +- testName, +- buildTest(binName, testName, opts), +- 2_000_000, +- ); ++ (skip ++ ? it.skip ++ : it)(testName, buildTest(binName, testName, opts), 2_000_000); + }); + + { + (skip ? it.skip : it)( + testName, + buildTest(binName, testName, opts), + 2_000_000, + ); + } + +``` + +**Prettier Similarity**: 66.67% + + +# js/last-argument-expansion/function-expression-issue-2239.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/function-expression.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/issue-10708.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/issue-7518.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/jsx.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/number-only-array.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/object.js + +**Prettier Similarity**: 100.00% + + +# js/last-argument-expansion/overflow.js + +**Prettier Similarity**: 100.00% + + +# js/line-suffix-boundary/boundary.js + +**Prettier Similarity**: 100.00% + + +# js/line/windows.js + +**Prettier Similarity**: 100.00% + + +# js/literal-numeric-separator/test.js + +**Prettier Similarity**: 100.00% + + +# js/literal/number.js + +**Prettier Similarity**: 100.00% + + +# js/logical-assignment/logical-assignment.js + +**Prettier Similarity**: 100.00% + + +# js/logical_expressions/issue-7024.js + +**Prettier Similarity**: 100.00% + + +# js/logical_expressions/logical_expression_operators.js + +**Prettier Similarity**: 100.00% + + +# js/member/conditional.js + +**Prettier Similarity**: 100.00% + + +# js/member/expand.js + +**Prettier Similarity**: 100.00% + + +# js/member/logical.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/13018.js +```diff + foo(_a).bar().leet(); + foo(-a).bar().leet(); +-foo(+a).bar().leet(); +-foo(~a).bar().leet(); +-foo(++a).bar().leet(); +-foo(--a).bar().leet(); +-foo(a++).bar().leet(); +-foo(a--).bar().leet(); ++foo(+a) ++ .bar() ++ .leet(); ++foo(~a) ++ .bar() ++ .leet(); ++foo(++a) ++ .bar() ++ .leet(); ++foo(--a) ++ .bar() ++ .leet(); ++foo(a++) ++ .bar() ++ .leet(); ++foo(a--) ++ .bar() ++ .leet(); + +``` + +**Prettier Similarity**: 10.00% + + +# js/method-chain/bracket_0-1.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/bracket_0.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/break-last-call.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/break-last-member.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/break-multiple.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/comment.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/complex-args.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/computed-merge.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/computed.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/conditional.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/cypress.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/d3.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/first_long.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/fluent-configuration.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/inline_merge.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/issue-11298.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/issue-3594.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/issue-3621.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/issue-4125.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/logical.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/multiple-members.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/object-literal.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/pr-7889.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/print-width-120/constructor.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/print-width-120/issue-7884.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/short-names.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/simple-args.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/square_0.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/test.js + +**Prettier Similarity**: 100.00% + + +# js/method-chain/this.js + +**Prettier Similarity**: 100.00% + + +# js/module-string-names/module-string-names-export.js + +**Prettier Similarity**: 100.00% + + +# js/module-string-names/module-string-names-import.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-comments/comment-inside.js +```diff + // #9274 + html` +
+ ${ + this.set && this.set.artist + /* avoid console errors if `this.set` is undefined */ + } +
+ `; + + html`${ + foo + /* comment */ + }`; + html` +- ${ +- foo +- /* comment */ +- } ++${ ++ foo ++ /* comment */ ++} + `; + ++graphql`${ ++ foo ++ /* comment */ ++}`; + graphql` +- ${ +- foo +- /* comment */ +- } +-`; +-graphql` +- ${ +- foo +- /* comment */ +- } ++${ ++ foo ++ /* comment */ ++} + `; + +-css` +- ${ +- foo +- /* comment */ +- } +-`; ++css`${ ++ foo ++ /* comment */ ++}`; + css` +- ${ +- foo +- /* comment */ +- } ++${ ++ foo ++ /* comment */ ++} + `; + + markdown`${ + foo + /* comment */ + }`; + markdown` + ${ + foo + /* comment */ + } + `; + + // https://github.com/prettier/prettier/pull/9278#issuecomment-700589195 + expr1 = html` +
+ ${x( + foo, // fg + bar, +- )} +-
++ )}
+ `; + +``` + +**Prettier Similarity**: 61.19% + + +# js/multiparser-comments/comments.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-comments/tagged.js +```diff + foo( + html // oops +- ` +-
+-

bar

+- foo +-
+- `, ++ `

bar

foo
`, + ); + +``` + +**Prettier Similarity**: 33.33% + + +# js/multiparser-css/colons-after-substitutions.js +```diff + const Icon = styled.div` + flex: none; +- transition: fill 0.25s; ++ transition: fill 0.25s; + width: 48px; + height: 48px; + + ${Link}:hover { +- fill: rebeccapurple; ++ fill: rebeccapurple; + } + + ${Link} :hover { + fill: yellow; + } + +- ${media.smallDown}::before { +- } ++ ${media.smallDown}::before {} + `; + +``` + +**Prettier Similarity**: 76.47% + + +# js/multiparser-css/colons-after-substitutions2.js +```diff + const Icon = styled.div` + height: 48px; + + ${Link}:nth-child(2) { + fill: rebeccapurple; + } + `; + + const Icon2 = styled.div` + height: 48px; + +- ${Link}:empty:before { ++ ${Link}:empty:before{ + fill: rebeccapurple; + } + `; + + const Icon3 = styled.div` + height: 48px; + + ${Link}:not(:first-child) { + fill: rebeccapurple; + } + `; + +``` + +**Prettier Similarity**: 95.65% + + +# js/multiparser-css/issue-11797.js +```diff + const paragraph1 = css` + font-size: 12px; +- transform: ${vert ? "translateY" : "translateX"} +- (${translation + handleOffset}px); ++ transform: ${vert ? "translateY" : "translateX"}(${translation + handleOffset}px); + `; + + const paragraph2 = css` + transform: ${expr}(30px); + `; + + const paragraph3 = css` + transform: ${expr} (30px); + `; + +``` + +**Prettier Similarity**: 84.62% + + +# js/multiparser-css/issue-2636.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-css/issue-2883.js +```diff + export const foo = css` +- &.foo .${bar}::before,&.foo[value="hello"] .${bar}::before { +- position: absolute; +- } ++&.foo .${bar}::before,&.foo[value="hello"] .${bar}::before { ++ position: absolute; ++} + `; + + export const foo2 = css` +- a.${bar}:focus,a.${bar}:hover { +- color: red; +- } ++a.${bar}:focus,a.${bar}:hover { ++ color: red; ++} + `; + + export const global = css` +- button.${foo}.${bar} { +- color: #fff; +- } ++button.${foo}.${bar} { ++ color: #fff; ++} + `; + +``` + +**Prettier Similarity**: 47.06% + + +# js/multiparser-css/issue-5697.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-css/issue-5961.js +```diff + const Steps = styled.div` + @media (min-width: 1px) { +- ${Step}:nth-child(odd) { +- } ++ ${Step}:nth-child(odd) {} + } + `; + + const Steps2 = styled.div` + @media (min-width: ${breakpoints.lg}) { + ${Step} { + margin-bottom: 90px; + } + + ${Step}:nth-child(odd) { + ${StepItemDescription} { + grid-row: 1; + grid-column: 3 / span 3; + } + ${Image} { + grid-row: 1; + grid-column: 7 / span 6; + } + } + + ${Step}:nth-child(even) { + ${Image} { + grid-row: 1; + grid-column: 3 / span 6; + } + ${StepItemDescription} { + grid-row: 1; + grid-column: 10 / span 3; + } + } + } + `; + +``` + +**Prettier Similarity**: 94.44% + + +# js/multiparser-css/issue-6259.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-css/issue-8352.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-css/issue-9072.js +```diff + const style1 = css` +- width: ${size + 10}${sizeUnit}; +- border: ${size / 10} ${sizeUnit} solid ${color}; ++ width:${size + 10}${sizeUnit}; ++ border:${size / 10} ${sizeUnit} solid ${color}; + `; + + const style2 = css` + width: ${size + 10}${sizeUnit}; + border: ${size / 10} ${sizeUnit} solid ${color}; + `; + + const style3 = css` +- foo: ${foo}${bar} ${baz}; ++ foo: ${foo}${bar} ${baz}; + `; + +``` + +**Prettier Similarity**: 76.92% + + +# js/multiparser-css/styled-components-multiple-expressions.js +```diff + const Header = styled.div` + ${something()} + & > ${Child}:not(:first-child) { +- margin-left: 5px; +- } ++margin-left:5px; ++} + `; + + const Header2 = styled.div` + ${something()} + & > ${Child}${Child2}:not(:first-child) { +- margin-left: 5px; +- } ++margin-left:5px; ++} + `; + +-styled.div` +- ${foo}-idle { +- } +-`; ++styled.div`${foo}-idle { }`; + +-styled.div` +- ${foo}-0-idle { +- } +-`; ++styled.div`${foo}-0-idle { }`; + + styled.div` +- font-family: "${a}", "${b}"; ++font-family: "${a}", "${b}"; + `; + +``` + +**Prettier Similarity**: 51.85% + + +# js/multiparser-css/styled-components.js +```diff + const ListItem1 = styled.li``; + +-const ListItem2 = styled.li``; ++const ListItem2 = styled.li` `; + +-const Dropdown = styled.div` +- position: relative; +-`; ++const Dropdown = styled.div`position: relative;`; + + const Button = styled.button` +- color: palevioletred; ++ color: palevioletred ; + +- font-size: 1em; ++ font-size : 1em ; + `; + + const TomatoButton = Button.extend` +- color: tomato; ++ color : tomato ; + +- border-color: tomato; ++border-color : tomato ++ ; ++ + `; + + Button.extend.attr({})` +- border-color: black; ++border-color : black; + `; + + styled(ExistingComponent)` +- color: papayawhip; +- background-color: firebrick; +-`; ++ color : papayawhip ; background-color: firebrick`; + + styled.button.attr({})` +- border: rebeccapurple; +-`; ++border : rebeccapurple`; + + styled(ExistingComponent).attr({})` +- border: rebeccapurple; +-`; ++border : rebeccapurple`; + + styled.div` + color: ${(props) => props.theme.colors.paragraph}; + /* prettier-ignore */ + ${(props) => (props.small ? "font-size: 0.8em;" : "")}; + `; + + styled.div` + color: ${(props) => props.theme.colors.paragraph}; + /* prettier-ignore */ + ${(props) => (props.small ? "font-size: 0.8em;" : "")} + `; + + styled.div` +- /* prettier-ignore */ ++ /* prettier-ignore */ + color: ${(props) => props.theme.colors.paragraph}; + ${(props) => (props.small ? "font-size: 0.8em;" : "")}; + `; + + styled.div` + color: ${(props) => props.theme.colors.paragraph}; + /* prettier-ignore */ + ${(props) => (props.small ? "font-size: 0.8em;" : "")}; + /* prettier-ignore */ + ${(props) => (props.red ? "color: red;" : "")}; + `; + + styled.div` + /* prettier-ignore */ + color: ${(props) => props.theme.colors.paragraph}; + /* prettier-ignore */ + ${(props) => (props.small ? "font-size: 0.8em;" : "")}; + /* prettier-ignore */ + ${(props) => (props.red ? "color: red;" : "")}; + /* prettier-ignore */ + `; + + styled.div` +- ${sanitize} ${fonts} ++ ${sanitize} ${fonts} + html { + margin: 0; + } + `; + + styled.div` + ${bar} + baz + `; + + styled.span` + foo + ${bar} + baz + `; + + styled.div` + foo + ${bar} + ${baz} + `; + + styled.span` + ${foo} + ${bar} + `; + + styled.div` + ${foo} bar + `; + + styled.span` + ${foo} ${bar} + baz: ${foo} + `; + + styled.span` +- ${foo}; +- ${bar}; ++${foo}; ++${bar}; + `; + + styled.span` +- ${foo}: ${bar}; ++${foo}: ${bar}; + `; + + styled.span` +- ${foo}: ${bar} ++${foo}: ${bar} + `; + + styled.span` +- ${foo}: ${bar} ++${foo}: ++${bar} + `; + + styled.span` +- ${foo}: ${bar}; ++${foo}: ++${bar}; + `; + + styled.a` + ${feedbackCountBlockCss} + text-decoration: none; + + ${FeedbackCount} { + margin: 0; + } + `; + + const StyledComponent1 = styled.div` + ${anInterpolation} + /* a comment */ + + .aRule { +- color: red; ++ color: red + } + `; + + const StyledComponent2 = styled.div` + ${anInterpolation} + + /* a comment */ + + .aRule { +- color: red; ++ color: red + } + `; + + const Direction = styled.span` + ${({ up }) => up && `color: ${color.positive};`} + ${({ down }) => down && `color: ${color.negative};`} + `; + + const Direction2 = styled.span` + ${({ up }) => up && `color: ${color.positive}`}; + ${({ down }) => down && `color: ${color.negative}`}; + `; + + const mixin = css` + color: ${(props) => props.color}; + ${(props) => props.otherProperty}: ${(props) => props.otherValue}; + `; + + const foo = styled.div` + display: flex; + ${(props) => props.useMixin && mixin} + `; + + const Single1 = styled.div` +- color: red; ++ color: red + `; + + const Single2 = styled.div` + color: red; + `; + + const Dropdown2 = styled.div` + /* A comment to avoid the prettier issue: https://github.com/prettier/prettier/issues/2291 */ + position: relative; + `; + + const bar = styled.div` + border-radius: 50%; + border: 5px solid rgba(var(--green-rgb), 0); + display: inline-block; + height: 40px; + width: 40px; + + ${(props) => + (props.complete || props.inProgress) && + css` + border-color: rgba(var(--green-rgb), 0.15); + `} + + div { + background-color: var(--purpleTT); + border-radius: 50%; + border: 4px solid rgba(var(--purple-rgb), 0.2); + color: var(--purpleTT); + display: inline-flex; + + ${(props) => + props.complete && + css` + background-color: var(--green); + border-width: 7px; + `} + + ${(props) => + (props.complete || props.inProgress) && + css` + border-color: var(--green); + `} + } + `; + + const A = styled.a` + display: inline-block; + color: #fff; + ${(props) => + props.a && + css` +- display: none; +- `} +- height: 30px; ++ display: none; ++ `} ++ height: 30px; + `; + + const Foo = styled.p` + max-width: 980px; + ${mediaBreakpointOnlyXs` + && { + font-size: 0.8rem; + } + `} + + &.bottom { + margin-top: 3rem; + } + `; + + styled(A)` + // prettier-ignore + @media (aaaaaaaaaaaaa) { + z-index: ${(props) => (props.isComplete ? "1" : "0")}; + } + `; + + const StyledDiv = styled.div` + ${(props) => getSize(props.$size.xs)} + ${(props) => getSize(props.$size.sm, "sm")} + ${(props) => getSize(props.$size.md, "md")} + `; + +``` + +**Prettier Similarity**: 88.64% + + +# js/multiparser-css/url.js +```diff +-styled.div` +- color: red; +- background: url(http://example.com?q=${foo}); +-`; ++styled.div`color:red;background: url(http://example.com?q=${foo})`; + +``` + +**Prettier Similarity**: 0.00% + + +# js/multiparser-css/var.js +```diff + const Something = styled.div` + background: var(--${one}); /* ... */ + border: 1px solid var(--${two}); /* ... */ + `; + + const StyledPurchaseCard = styled(Card)` + min-width: 200px; + background-color: var(--${(props) => props.color}); + color: #fff; + `; + + const v1 = css` +- prop: var(--global--color--${props.variant}); ++prop: var(--global--color--${props.variant}); + `; + + const v2 = css` +- background-color: var(--global--color--${props.variant}); ++ background-color: var(--global--color--${props.variant}); + +- &:hover { +- background-color: var(--global--color--${props.variant}__one); +- } +-`; ++ &:hover { ++ background-color: var(--global--color--${props.variant}__one); ++ } ++ `; + + export const StyledComponent = styled.div` +- grid-area: area-${(props) => props.propName}; ++ grid-area: area-${(props) => props.propName}; + `; + +``` + +**Prettier Similarity**: 73.08% + + +# js/multiparser-graphql/comment-tag.js +```diff + const query = /* GraphQL */ ` +- { +- user(id: 5) { ++ { ++ user( id : 5 ) { + firstName + + lastName + } + } + `; + +``` + +**Prettier Similarity**: 77.78% + + +# js/multiparser-graphql/definitions.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-graphql/escape.js +```diff + gql` + "\`foo\` mutation payload." +- type FooPayload { +- bar: String ++ type FooPayload { ++ bar: String + } + `; + + gql` +- type Project { ++type Project { + "Pattern: \`\${project}\`" + pattern: String + """ + Pattern: \`\${project}\` + """ + pattern: String + +- # Also: Escaping the first parentheses... +- "Pattern: \`\${project}\`" ++ # Also: Escaping the first parentheses... ++ "Pattern: \`$\{project}\`" + pattern: String + # Or escaping the first and second parentheses... +- "Pattern: \`\${project}\`" ++ "Pattern: \`$\{project\}\`" + pattern: String +- } ++} + `; + + gql` + """ + - \` + - \\\` + - \\ a + - \\\\ + - $ + - \$ + - \${ + - \\\${ + - \u1234 + """ + type A { + a + } + `; + +``` + +**Prettier Similarity**: 82.93% + + +# js/multiparser-graphql/expressions.js +```diff + graphql( + schema, + ` +- query allPartsByManufacturerName($name: String!) { +- allParts(filter: { manufacturer: { name: $name } }) { +- ...PartAll +- } +- } +- ${fragments.all} +- `, ++query allPartsByManufacturerName($name: String!) { ++ allParts(filter:{manufacturer: {name: $name}}) { ++... PartAll ++}} ++${fragments.all} ++`, + ); + + const veryLongVariableNameToMakeTheLineBreak = graphql( + schema, + ` +- query allPartsByManufacturerName($name: String!) { +- allParts(filter: { manufacturer: { name: $name } }) { +- ...PartAll +- } +- } +- ${fragments.all} +- `, ++query allPartsByManufacturerName($name: String!) { ++ allParts(filter:{manufacturer: {name: $name}}) { ++... PartAll ++}} ++${fragments.all} ++`, + ); + +``` + +**Prettier Similarity**: 39.13% + + +# js/multiparser-graphql/graphql-tag.js +```diff + import gql from "graphql-tag"; + + const query = gql` +- { +- user(id: 5) { ++ { ++ user( id : 5 ) { + firstName + + lastName + } + } + `; + + // With interpolations: + + gql` +- query User { +- user(id: 5) { +- ...UserDetails +- ...Friends +- } ++query User { ++ user(id:5){ ++ ...UserDetails ++ ...Friends + } ++} + +- ${USER_DETAILS_FRAGMENT} +- ${FRIENDS_FRAGMENT} ++${USER_DETAILS_FRAGMENT}${FRIENDS_FRAGMENT} + `; + + // Skip if non-toplevel interpolation: + + gql` + query User { + user(id:${id}){ name } + } + `; + + // Skip if top-level interpolation within comment: + + gql` + query User { + user(id:5){ name } + } + #${test} + `; + + // Comment on last line: + + gql` +- query User { +- user(id: 5) { +- name +- } +- } +- # comment +-`; ++query User { ++ user(id:5){ name } ++} ++# comment`; + // ` <-- editor syntax highlighting workaround + + // Preserve up to one blank line between things and enforce linebreak between + // interpolations: + + gql` +- # comment +- ${one} +- ${two} +- ${three} +- ${four} ++# comment ++${one}${two} ${three} ++${four} + +- ${five} +- # comment +- ${six} ++${five} ++# comment ++${six} + +- # comment +- ${seven} +- # comment ++# comment ++${seven} ++# comment ++ ++${eight} ++ ++ # comment with trailing whitespace + +- ${eight} + +- # comment with trailing whitespace ++# blank line above this comment ++ + +- # blank line above this comment + `; + + // Interpolation directly before and after query: + +-gql` +- ${one} +- query Test { +- test +- } +- ${two} +-`; ++gql`${one} query Test { test }${two}`; + + // Only interpolation: + +-gql` +- ${test} +-`; ++gql`${test}`; + + // Only comment: + +-gql` +- # comment +-`; ++gql`# comment`; + // ` <-- editor syntax highlighting workaround + + // Only whitespace: + +-gql``; ++gql` `; + + // Empty: + + gql``; + + // Comments after other things: + // Currently, comments after interpolations are moved to the next line. + // We might want to keep them on the next line in the future. + + gql` +- ${test} +- # comment ++ ${test} # comment + +- query Test { +- # comment ++ query Test { # comment + test # comment + } # comment +- ${test} +- # comment +- ${test} +- # comment ++ ${test} # comment ++ ${test} # comment + +- ${test} +- # comment ++ ${test} # comment + + # comment +- ${test} +- # comment ++ ${test} # comment + `; + + // Larger mixed test: + + gql` +- query User { +- test +- } + +- ${USER_DETAILS_FRAGMENT} + +- # Comment +- # that continues on a new line + +- # and has a blank line in the middle ++query User { ++ test ++} ++ ++ ++ ++${USER_DETAILS_FRAGMENT} + +- ${FRIENDS_FRAGMENT} ++ # Comment ++ # that continues on a new line ++ ++ ++ # and has a blank line in the middle ++ ++ ${FRIENDS_FRAGMENT} + ${generateFragment({ + totally: "a good idea", + })} + +- ${fragment} +- #comment ++${fragment}#comment + +- fragment another on User { +- name +- } +- ${fragment} +-`; ++fragment another on User { name ++}${fragment}`; + +``` + +**Prettier Similarity**: 56.44% + + +# js/multiparser-graphql/graphql.js +```diff + graphql( + schema, + ` +- mutation MarkReadNotificationMutation($input: MarkReadNotificationData!) { +- markReadNotification(data: $input) { +- notification { +- seenState +- } +- } +- } +- `, ++mutation MarkReadNotificationMutation( ++ $input ++ : MarkReadNotificationData! ++ ) ++{ markReadNotification(data: $input ) { notification {seenState} } }`, + ); + +``` + +**Prettier Similarity**: 33.33% + + +# js/multiparser-graphql/invalid.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-graphql/react-relay.js +```diff + const { graphql } = require("react-relay"); + + graphql` +- mutation MarkReadNotificationMutation($input: MarkReadNotificationData!) { +- markReadNotification(data: $input) { +- notification { +- seenState +- } +- } +- } ++ mutation MarkReadNotificationMutation( ++ $input ++ : MarkReadNotificationData! ++ ) ++{ markReadNotification(data: $input ) { notification {seenState} } } + `; + + graphql.experimental` +- mutation MarkReadNotificationMutation($input: MarkReadNotificationData!) { +- markReadNotification(data: $input) { +- notification { +- seenState +- } +- } +- } ++ mutation MarkReadNotificationMutation( ++ $input ++ : MarkReadNotificationData! ++ ) ++{ markReadNotification(data: $input ) { notification {seenState} } } + `; + +``` + +**Prettier Similarity**: 33.33% + + +# js/multiparser-html/html-template-literals.js +```diff + const nestedFun = /* HTML */ `${outerExpr(1)} + `; + + const nestedFun2 = /* HTML */ `${outerExpr(1)} + `; + + setFoo( + html`
one
+
two
+
three
`, + secondArgument, + ); + + setFoo( + html`
+
nested
+
+
two
+
three
`, + secondArgument, + ); + + setFoo( + html`
+
nested
+
`, + secondArgument, + ); + +``` + +**Prettier Similarity**: 96.88% + + +# js/multiparser-html/issue-10691.js +```diff + export default function include_photoswipe(gallery_selector = ".my-gallery") { +- return /* HTML */ ` `; ++ return /* HTML */ ` ++ `; + } + +``` + +**Prettier Similarity**: 25.00% + + +# js/multiparser-html/language-comment/not-language-comment.js + +**Prettier Similarity**: 100.00% + + +# js/multiparser-html/lit-html.js +```diff + import { LitElement, html } from "@polymer/lit-element"; + + class MyElement extends LitElement { + static get properties() { + return { + mood: { type: String }, + }; + } + + constructor() { + super(); + this.mood = "happy"; + } + + render() { + return html` +- ++ + +- Web Components are ${this.mood}! ++ Web Components are ${this.mood}! + `; + } + } + + customElements.define("my-element", MyElement); + +-const someHtml1 = html`
hello ${world}
`; +-const someHtml2 = /* HTML */ `
hello ${world}
`; ++const someHtml1 = html`
hello ${world}
`; ++const someHtml2 = /* HTML */ `
hello ${world}
`; + + html``; + + html``; + +-html` <${Footer}>footer content `; ++html` <${Footer} >footer content `; + +-html`
`; ++html`
`; + +-html`
`; ++html` ++
++`; + + html`onetwothree`; + + function HelloWorld() { + return html` +

Bar List

+- ${bars.map((bar) => html`

${bar}

`)} ++ ${bars.map( ++ (bar) => html` ++

${bar}

++ `, ++ )} + `; + } + +-const trickyParens = html``; +-const nestedFun = /* HTML */ `${outerExpr(1)} +- `; ++const trickyParens = html``; ++const nestedFun = /* HTML */ `${outerExpr( ++ 1, ++)} `; + + const closingScriptTagShouldBeEscapedProperly = /* HTML */ ` + + `; + +-const closingScriptTag2 = /* HTML */ ``; ++const closingScriptTag2 = /* HTML */ `