Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📚 Remove outdated differences with Prettier #515

Open
1 task done
FloEdelmann opened this issue Jun 5, 2024 · 1 comment
Open
1 task done

📚 Remove outdated differences with Prettier #515

FloEdelmann opened this issue Jun 5, 2024 · 1 comment

Comments

@FloEdelmann
Copy link

FloEdelmann commented Jun 5, 2024

Documentation URL

https://biomejs.dev/formatter/differences-with-prettier/

Description

Some documented differences with Prettier are no longer differences because Prettier's behavior changed in the meantime:

Prettier doesn’t unquote some object properties that are valid JavaScript identifiers

✔️ Still correct
Code example in Prettier Playground | Code example in Biome Playground

Prettier has an inconsistent behavior for assignment in computed keys.

✔️ Still correct
Code example in Prettier Playground | Code example in Biome Playground

Prettier adds a trailing comma to type parameters of arrow functions even when it is not required.

✔️ Still correct
Code example in Prettier Playground | Code example in Biome Playground

Prettier has an inconsistent behavior for parenthesized non-null-asserted optional chains

⚠️ Prettier throws an error now about the invalid syntax
Code example in Prettier Playground | Code example in Biome Playground

Prettier formats invalid syntaxes – Duplicate modifiers on class properties

⚠️ Prettier throws an error now about the invalid syntax
Code example in Prettier Playground | Code example in Biome Playground

Prettier formats invalid syntaxes – Assignment to an optional chain

✔️ Still correct
Code example in Prettier Playground | Code example in Biome Playground

Prettier formats invalid syntaxes – Incorrect modifier for the type parameters of an interface

✔️ Still correct
Code example in Prettier Playground | Code example in Biome Playground

Prettier formats invalid syntaxes – Top-level return

✔️ Still correct
Code example in Prettier Playground | Code example in Biome Playground

Prettier formats invalid syntaxes – Erroneous self-increment and self-decrement

⚠️ Prettier throws an error now about the invalid syntax
Code example in Prettier Playground | Code example in Biome Playground

Prettier formats invalid syntaxes – Use of abstract modifier in non-abstract classes

✔️ Still correct
Code example in Prettier Playground | Code example in Biome Playground

Prettier has inconsistencies between TypeScript and Babel parsing

⚠️ Prettier formats the code consistently now with the babel/babel-ts/typescript parsers
Code example in Prettier Playground | Code example in Biome Playground

Expectations

For all differences with a ✔️:

  • These are fine, so nothing to change here.

For all differences with a ⚠️:

  • Either the issue is fixed in Prettier completely, then there is no difference between Biome's and Prettier's behavior anymore, so the corresponding section should be removed from the docs.
  • Or the issue is only partially fixed in Prettier (at least for the documented code example), but still persists for other code examples. Then the documentation should be updated to include a code example that actually highlights the difference between Biome's and Prettier's behavior.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@aojunhao123
Copy link

I’d like to take on this issue and update the documentation to reflect the current differences with Prettier. I’ll review the current discrepancies and make the necessary adjustments. Please assign this issue to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants