AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.16k stars 236 forks source link

[Typescript pack] prettierd formatting give weird result with tsx files #993

Closed anispwyn closed 4 months ago

anispwyn commented 4 months ago

Checklist

Neovim version (nvim -v)

NVIM v0.10.0

Operating system/version

EndeavourOS rolling x86_64 (Linux 6.9.1-zen1-2-zen)

Terminal/GUI

kitty

Describe the bug

whatever i try to format tsx files, the formatter(prettierd) give weird result which doesnt happen with prettier cli or biome cli

Steps to Reproduce

  1. open to any tsx files that havent been formatted
  2. type :Format
  3. result

Expected behavior

prettierd should give the same result as prettier/biome

Screenshots

https://asciinema.org/a/XJJtP0MXdRS8lQgAOqFKRhzuu

Additional Context

No response

Uzaaft commented 4 months ago

Prettierd should not give the same result as biome😂.

can you give us an example file and the resulting formatted file

anispwyn commented 4 months ago

i thought biome is just faster prettier well here's the original file https://files.anisp.xyz/u/jL6JqS.js

formatted file https://files.anisp.xyz/u/bHv0hb.js

(the file extension should be jsx/tsx but my file uploader automatically change that for some reason)

Uzaaft commented 4 months ago

Make sure you've updated all the plugins. And remove tsserver.

Uzaaft commented 4 months ago

This seems to me a user error -> user hasn't updated deps.

Uzaaft commented 4 months ago

i thought biome is just faster prettier well here's the original file https://files.anisp.xyz/u/jL6JqS.js

formatted file https://files.anisp.xyz/u/bHv0hb.js

(the file extension should be jsx/tsx but my file uploader automatically change that for some reason)

No, biome has other defaults. Read their docs.

anispwyn commented 4 months ago

seems to be working now, thanks