semantic-release / npm

:ship: semantic-release plugin to publish a npm package
MIT License
238 stars 112 forks source link

Array format/style is being changed #789

Closed Th3S4mur41 closed 2 months ago

Th3S4mur41 commented 2 months ago

We use @biomejs in our project to format JS and JSON files including package.json

As a result, arrays in the package.json are formatted as a single line:

{
  "keywords": ["webapp", "test", "whatever", "keywords", "and-some-more"],
  "workspaces": ["packages/*"],
}

When running semantic release, those arrays are being formatted to multi-line (regardless of the line length). Which is leading to a the format check failing in CI.

{
  "keywords": [
    "webapp",
    "test",
    "whatever",
    "keywords",
    "and-some-more"
  ],
  "workspaces": [
    "packages/*"
  ],
}

I would expect that semantic release should only update the version, but not change the file's format/style.

Th3S4mur41 commented 2 months ago

@Conaclos FYI

Th3S4mur41 commented 2 months ago

Closing this, since the format is actually be changed by npm itself when running npm version

Conaclos commented 2 months ago

I think it could make sense of adding an option to the Biome formatter to expand JSON (and thus match output of JSON.stringify). This could be used for config files.