browserslist / update-db

CLI tool to update caniuse-lite to refresh target browsers from Browserslist config
https://browsersl.ist/
MIT License
286 stars 57 forks source link

Detect and preserve npm package-lock.json file indentation #5

Closed alexanderanchishkin closed 1 year ago

alexanderanchishkin commented 1 year ago

I used detect-indent package as it was used for npm install fix

ai commented 1 year ago

Can we avoid extra dependency and write a small function to do it? Our use case is very simple to use extra dependency for that.

alexanderanchishkin commented 1 year ago

Sure. I fixed it. But I discovered interesting fact. Really npm v7+ doesn't preserve indentation style after npm install (and we use it for updating). More information about it here. It uses indentation of package.json file. So this PR was useful only for npm version less v7. Our team use npm v6 now so we'll find it useful.

ai commented 1 year ago

Thanks. Released in 1.0.6.