withastro/astro

🐛 BUG: version 2.8.1 removes trailing comma on save

已关闭

#14,665 创建于 2024年3月29日

 (7 条评论) (0 个反应) (0 位负责人)TypeScript (3,722 个派生)batch import
good first issuepkg: language-tools

仓库指标

星标
 (61,877 个星标)
PR 合并指标
 (平均合并 4天 23小时) (30 天内合并 197 个 PR)

描述

Describe the Bug

When I save an astro file, it removes trailing commas from multi-line function calls.

If I downgrade to version 2.8.0 and save, it adds them back again when I save.

I wonder if it is also related to withastro/language-tools#823 - I found another issue that sounded like it was similarly affected, withastro/language-tools#829 - though the specific fix for that one did not address this one.

Steps to Reproduce

  1. Open any .astro file with multi-line function calls. E.g.
    foo(
      var1,
      var2,
    );
    
  2. save the file
  3. trailing commas are removed. For the above example it would change to:
    foo(
      var1,
      var2
    );
    

EDIT: After comments, here is a better example, since the above ends up on a single line which does not have trailing comma:

  someReallyLongNAmeThingThatIsReallyLong(
    someReallyLongVarThatISLongAnd,
    SomeOtherReallyLongThing,
  );

贡献者指南