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

lerna repair does not respect prettier configuration #3925

Open
1 task
ndrone-kr opened this issue Dec 27, 2023 · 4 comments
Open
1 task

lerna repair does not respect prettier configuration #3925

ndrone-kr opened this issue Dec 27, 2023 · 4 comments

Comments

@ndrone-kr
Copy link

Description

Currently my teams package.json files are using an indent of 4 spaces. When running lerna repair it reconfigures the root project.json to use 2 spaces. It would be nice if we were able to control the indent spacing within the lerna.json file.

Motivation

So teams that have different spacing in their package.json files remain untouched.

Suggested Implementation

ability to set indent within lerna.json file

{
    indent: 2
}

Alternate Implementations

or via a flag --indent=2

@fahslaj
Copy link
Contributor

fahslaj commented Dec 28, 2023

Hi @ndrone-kr, do you happen to be using Prettier in your repo? Lerna will detect an installed prettier configuration and automatically run it on the files that it updates with lerna repair to ensure that workspace formatting rules are respected. If you are using prettier and want to ignore package.json, you can add it to the .prettierignore file (https://prettier.io/docs/en/ignore.html)

@ndrone-kr
Copy link
Author

I am using prettier. Let me update the .prettierignore and run some tests. Thanks for the info

@ndrone-kr
Copy link
Author

After updating the .prettierignore file adding package.json then running lerna repair it still updated the package.json file back to an indent of 2.

@fahslaj
Copy link
Contributor

fahslaj commented Jan 2, 2024

Thanks for following up @ndrone-kr . I've recreated the issue. It looks like prettier config is not being properly respected during the repair command. I'm looking into a fix.

@fahslaj fahslaj changed the title Ability to control indent spacing within package.json lerna repair does not respect prettier configuration Jan 2, 2024
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

2 participants