crates/biome_js_formatter/report-challenge.md
Challenge: https://console.algora.io/challenges/prettier
We provide two compatibility reports for the challenge:
You can test Biome directly on the playground, or using our latest nightly release.
npm install -D @biomejs/[email protected]
Please find more details in our Getting Started guide.
report-es215 and report-es2024+ ignore the following test cases:
JSX
js/binary-expressions/inline-jsx.jsjs/binary-expressions/jsx_parent.jsjs/call/first-argument-expansion/jsx.jsjs/comments-closure-typecast/styled-components.jsjs/comments/html-like/js/comments/jsx.jsjs/comments/return-statement.jsjs/last-argument-expansion/jsx.jsjs/trailing-comma/jsx.jsjs/throw_statement/jsx.jsjs/unicode/nbsp-jsx.jsjs/yield/jsx-without-parenthesis.jsjs/yield/jsx.jsEmbedded language formatting inside template literals
js/multiparser-comments/js/multiparser-css/js/multiparser-graphql/js/multiparser-html/js/multiparser-invalid/js/multiparser-markdown/js/multiparser-text/js/template-literals/css-prop.jsjs/template-literals/styled-components-with-expressions.jsjs/template-literals/styled-jsx-with-expressions.jsjs/template-literals/styled-jsx.jsjs/range/issue-7082.jsjs/last-argument-expansion/embed.jsjs/last-argument-expansion/embed.jsNon-standard and experimental syntaxes
js/v8_intrinsicjs/babel-plugins/js/async-do-expressions/js/do/export X from "mod"
js/export-default/export-default-from/js/export-default/escaped/default-escaped.jsmodule <id> {}
js/module-blocksjs/explicit-resource-management/valid-module-block-top-level-await-using-binding.jsjs/explicit-resource-management/valid-module-block-top-level-using-binding.js#[] and #{}
js/tuplejs/recordjs/arrays/tuple-and-record.jsjs/arrows/tuple-and-record.jsjs/binary-expressions/tuple-and-record.jsjs/class-extends/tuple-and-record.jsjs/comments-closure-typecast/tuple-and-record.jsjs/comments/tuple-and-record.jsjs/function-single-destructuring/tuple-and-record.jsjs/method-chain/tuple-and-record.js|>
js/comments-pipeline-own-linejs/partial-applicationjs/pipeline-operator::
js/arrows-bind/js/bind-expressions/js/objects/expression.jsjs/no-semi-babylon-extensions/no-semi.jsjs/destructuring-private-fields/
js/deferred-import-evaluation/js/source-phase-imports/js/import-reflection/In addition to these ignored tests cases, report-es215 also ignores the following test cases:
Widespread experimental syntaxes
js/decoratorsjs/decorator-auto-accessors/js/decorators-export/js/ignore/class-expression-decorator.jsjs/ignore/decorator.jsjs/import-assertions/js/import-attributes/js/explicit-resource-managementStandard ES2016+ syntaxes
**
js/async/exponentiation.jsjs/binary-expressions/exp.jsasync function and async () => and await
js/async/js/arrows/newline-before-arrow/newline-before-arrow.jsjs/assignment/discussion-15196.jsjs/assignment/issue-5610.jsjs/assignment/issue-7091.jsjs/assignment/issue-10218.jsjs/assignment/lone-arg.jsjs/ignore/issue-14404.jsjs/trailing-comma/function-calls.jsjs/arrows/arrow-chain-with-trailing-comments.js{ ...x }
js/spreadjs/destructuring/js/destructuring-ignore/js/assignment/destructuring-heuristic.jsjs/assignment/destructuring.jsjs/function-single-destructuring/object.jsjs/last-argument-expansion/assignment-pattern.jsjs/last-argument-expansion/issue-10708.jsjs/last-argument-expansion/issue-7518.jsfor await
js/for-await/#field
js/classes-private-fieldsjs/no-semi/private-field.jstry {} catch {}
js/optional-catch-bindinga ?? b
js/nullish-coalescingjs/arrows/chain-in-logical-expression.jsprop?.
js/optional-chaining/js/optional-chaining-assignment/js/chain-expression/test.jsjs/big-int/js/objects/bigint-key.js1_000
js/literal-numeric-separator/js/quote-props/numeric-separator.js??=, &&=, ...
js/logical-assignment/#field in
js/private-injs/classes/keyword-property/private.jsjs/decorator-auto-accessors/private.jsjs/decorator-auto-accessors/static-private.jsjs/classes/class-fields-features.jsstatic {}
js/class-static-block/await
js/top-level-await/d flag /regex/d
#!/usr/bin/node
js/shebang/v flag /regex/v
js/regex/v-flag.jsThe following test cases are handled in non-strict JavaScript mode, also known as sloppy mode or script mode.
js/with/js/sloppy-mode/js/identifier/When formatted twice using Prettier, some tests cases are formatted differently. The Biome testing infrastructure catches this kind of issues.
We decided to match the stabilized formatted version (i.e. the one obtained after multiple run of Prettier on the input - actually a second run is enough to stabilize the output).
The following test cases are affected by this formatting issue:
js/sequence-expression/parenthesized.jsjs/comments/tagged-template-literal.jsjs/comments/return-statement.jsjs/last-argument-expansion/embed.jsjs/for/continue-and-break-comment-without-blocks.jsjs/class-comment/misc.jsjs/range/boundary.jsjs/range/class-declaration.jsjs/range/multiple-statements2.jsSome divergences are deliberate, because of the strictness of Biome parsing phase or because we think it is more readable to keep the way it is. You can find a detailed description of these test cases in the dedicated issue.
We implemented all JavaScript options provided by Prettier.
See the documentation of the global configuration for formatter and the specific configuration for the JavaScript formatter.
In contrast to Prettier, Biome only provides as-needed and preserve values for quoteProps. It doesn't provide the consistent value.
This is a deliberate choice.