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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

lerna format pnpm-lock.yaml with prettier #3476

Closed
chambo-e opened this issue Dec 27, 2022 · 3 comments
Closed

lerna format pnpm-lock.yaml with prettier #3476

chambo-e opened this issue Dec 27, 2022 · 3 comments

Comments

@chambo-e
Copy link

chambo-e commented Dec 27, 2022

Current Behavior

Hello 馃憢
There is an issue when using lerna with pnpm and prettier since #3284
It runs prettier when adding the pnpm-lock.yaml (here)

I assumed it would respect the prettierignore but that does not seems to work either

Expected Behavior

Prettier should not be run on pnpm-lock.yaml as the indentation from pnpm is different

There might be a way to fetch the prettierignore and ignore specified files/paths :)

Steps to Reproduce

You can see a reproduction from our repo here (commit result from lerna publish) scaleway/scaleway-lib@8f789ed#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bb

I assume a pretty straightforward way of reproducing would be to have a repository with pnpm + lerna + prettier in devDeps and trigger a lerna version :)

Failure Logs / Configuration

{
  "packages": ["packages/*"],
  "useWorkspaces": true,
  "npmClient": "pnpm",
  "version": "independent",
  "command": {
    "publish": {
      "conventionalCommits": true,
      "changelogPreset": "conventionalcommits"
    },
    "version": {
      "message": "chore(release): publish"
    }
  }
}

Environment

Environment info:

  System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1 Pro
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Utilities:
    Git: 2.38.1 - /opt/homebrew/bin/git
  npmPackages:
    lerna: 6.1.0 => 6.1.0 
@JamesHenry
Copy link
Member

Thanks for the report @chambo-e this should be resolved by #3482 which causes the automatic formatting to always respect the .prettierignore file

@chambo-e
Copy link
Author

chambo-e commented Jan 6, 2023

Works like a charm, thanks :)

@Leksat
Copy link

Leksat commented Mar 14, 2023

It would be nice if pnpm-lock.yaml is excluded by default.

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