From 708ce96faa83b9c530760b680f8ee31117e4eccc Mon Sep 17 00:00:00 2001 From: Victorien Elvinger Date: Sun, 19 Nov 2023 22:02:23 +0100 Subject: [PATCH] chore(challenge): refine reports (#796) --- .../biome_formatter_test/src/diff_report.rs | 6 +- crates/biome_js_formatter/report.md | 166 +----------------- .../biome_js_formatter/report_incompatible.md | 166 +----------------- 3 files changed, 9 insertions(+), 329 deletions(-) diff --git a/crates/biome_formatter_test/src/diff_report.rs b/crates/biome_formatter_test/src/diff_report.rs index 3e61b72deded..8bb6cdb25817 100644 --- a/crates/biome_formatter_test/src/diff_report.rs +++ b/crates/biome_formatter_test/src/diff_report.rs @@ -109,11 +109,12 @@ impl DiffReport { "arrows-bind", "async-do-expressions", "async-do-expressions", + "babylon-extensions", "decimal", "do-expressions", "export-default-from", "function-bind", - "module-blocks", + "module-block", "partial-application", "pipeline", "record", @@ -122,6 +123,7 @@ impl DiffReport { "v8intrinsic", "v8_intrinsic", "bind-expressions", + "js/objects/expression.js", "destructuring-private-fields", "/do/", "export-extension", @@ -134,6 +136,8 @@ impl DiffReport { "js/range/issue-7082.js", "js/template-literals/css-prop.js", "js/template-literals/styled", + "js/last-argument-expansion/embed.js", + "typescript/as/as-const-embedded.ts", ]; patterns.iter().any(|pattern| file_name.contains(pattern)) diff --git a/crates/biome_js_formatter/report.md b/crates/biome_js_formatter/report.md index 9b59cf9e903d..1b5023d3eb4f 100644 --- a/crates/biome_js_formatter/report.md +++ b/crates/biome_js_formatter/report.md @@ -1,6 +1,6 @@ # Overall Metrics -**Average compatibility**: 95.39 +**Average compatibility**: 95.62
Definition @@ -8,7 +8,7 @@ $$average = \frac\{\sum_{file}^\{files}compatibility_\{file}}\{files}$$
- **Compatible lines**: 95.85 + **Compatible lines**: 96.05
Definition @@ -3526,34 +3526,6 @@ **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% @@ -4589,58 +4561,6 @@ **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% @@ -4967,26 +4887,6 @@ **Prettier Similarity**: 100.00% -# js/no-semi-babylon-extensions/no-semi.js -```diff - a; --::b.c; -+::b.c - - class A { - a = b; - in; - c; - - a = b; - instanceof() {} - } - -``` - -**Prettier Similarity**: 90.91% - - # js/no-semi/class.js **Prettier Similarity**: 100.00% @@ -5109,43 +5009,6 @@ **Prettier Similarity**: 100.00% -# js/objects/expression.js -```diff - () => ({})``; - ({})``; - a = () => ({}).x; - ({}) && a, b; --({})::b, 0; --({})::b()``[""].c++ && 0 ? 0 : 0, 0; -+({} -+::b, 0) -+({} -+::b()``[''].c++ && 0 ? 0 : 0, 0) - ({})(), 0; - ({} = 0); - ({} = 0), 1; - - const a1 = { - someKey: (shortName, shortName), - }; - - const a2 = { - someKey: - (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, shortName), - }; - - const a3 = { - someKey: - (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, - longLongLongLongLongLongLongLongLongLongLongLongLongLongName, - longLongLongLongLongLongLongLongLongLongLongLongLongLongName), - }; - -``` - -**Prettier Similarity**: 85.19% - - # js/objects/getter-setter.js **Prettier Similarity**: 100.00% @@ -7960,31 +7823,6 @@ **Prettier Similarity**: 100.00% -# typescript/as/as-const-embedded.ts -```diff - const GQL_QUERY_WITH_CONST = /* GraphQL */ ` -- query S { -- shop -- } -+ query S { shop } - ` as const; - - const HTML_WITH_CONST = /* HTML */ ` --
--

foo

--

foo

--
-+
-+

foo

-+

foo

-+
- ` as const; - -``` - -**Prettier Similarity**: 41.67% - - # typescript/as/as.ts **Prettier Similarity**: 100.00% diff --git a/crates/biome_js_formatter/report_incompatible.md b/crates/biome_js_formatter/report_incompatible.md index ce17f7c0124a..4868cf52b949 100644 --- a/crates/biome_js_formatter/report_incompatible.md +++ b/crates/biome_js_formatter/report_incompatible.md @@ -1,6 +1,6 @@ # Overall Metrics -**Average compatibility**: 95.39 +**Average compatibility**: 95.62
Definition @@ -8,7 +8,7 @@ $$average = \frac\{\sum_{file}^\{files}compatibility_\{file}}\{files}$$
- **Compatible lines**: 95.85 + **Compatible lines**: 96.05
Definition @@ -1901,34 +1901,6 @@ **Prettier Similarity**: 89.47% -# 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-binding-escaped.js ```diff { @@ -2404,58 +2376,6 @@ **Prettier Similarity**: 20.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/function-body-in-mode-break.js ```diff fs.readdirSync(suiteLoc).forEach(function (testName) { @@ -2482,26 +2402,6 @@ **Prettier Similarity**: 66.67% -# js/no-semi-babylon-extensions/no-semi.js -```diff - a; --::b.c; -+::b.c - - class A { - a = b; - in; - c; - - a = b; - instanceof() {} - } - -``` - -**Prettier Similarity**: 90.91% - - # js/objects/assignment-expression/object-property.js ```diff a = { @@ -2514,43 +2414,6 @@ **Prettier Similarity**: 66.67% -# js/objects/expression.js -```diff - () => ({})``; - ({})``; - a = () => ({}).x; - ({}) && a, b; --({})::b, 0; --({})::b()``[""].c++ && 0 ? 0 : 0, 0; -+({} -+::b, 0) -+({} -+::b()``[''].c++ && 0 ? 0 : 0, 0) - ({})(), 0; - ({} = 0); - ({} = 0), 1; - - const a1 = { - someKey: (shortName, shortName), - }; - - const a2 = { - someKey: - (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, shortName), - }; - - const a3 = { - someKey: - (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, - longLongLongLongLongLongLongLongLongLongLongLongLongLongName, - longLongLongLongLongLongLongLongLongLongLongLongLongLongName), - }; - -``` - -**Prettier Similarity**: 85.19% - - # js/optional-chaining-assignment/valid-parenthesized.js ```diff -a?.b = c; @@ -4390,31 +4253,6 @@ **Prettier Similarity**: 0.00% -# typescript/as/as-const-embedded.ts -```diff - const GQL_QUERY_WITH_CONST = /* GraphQL */ ` -- query S { -- shop -- } -+ query S { shop } - ` as const; - - const HTML_WITH_CONST = /* HTML */ ` --
--

foo

--

foo

--
-+
-+

foo

-+

foo

-+
- ` as const; - -``` - -**Prettier Similarity**: 41.67% - - # typescript/as/expression-statement.ts ```diff // expression statemnt of "as" expression hardly ever makes sense, but it's still valid.