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

updtr eats my tabs in package.json and replaces it with spaces (npm) #68

Closed
moritzjacobs opened this issue Dec 7, 2017 · 1 comment
Closed

Comments

@moritzjacobs
Copy link
Contributor

Awesome tool, I just have a small, very low priority issue with it: I use tabs in my package.json – I know, right? npm totally respects my decision, updtr does not, here's a reproducible testcase:

mkdir updtr-test
cd updtr-test
npm init --yes

gives us this package.json:

{
  "name": "updtr-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

Now remove the test (so updtr doesn't fail later) and entab:

{
	"name": "updtr-test",
	"version": "1.0.0",
	"description": "",
	"main": "index.js",
	"scripts": {},
	"keywords": [],
	"author": "",
	"license": "ISC"
}

then npm i del@2.2.2, which is an old version. package.json looks like:

{
	"name": "updtr-test",
	"version": "1.0.0",
	"description": "",
	"main": "index.js",
	"scripts": {},
	"keywords": [],
	"author": "",
	"license": "ISC",
	"dependencies": {
		"del": "^2.2.2"
	}
}

So tabs all the way. Nice. Now run updtr, lo and behold:

{
  "name": "updtr-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {},
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "del": "^3.0.0"
  }
}

... we're back to 2 spaces, or as I call it: no indentation at all.

Nothing prettier doesn't solve for me, just a small issue. Great tool tho!

@jhnns jhnns closed this as completed in #77 Oct 3, 2018
jhnns pushed a commit that referenced this issue Oct 3, 2018
Respects the user's indentation in their `package.json`

Fixes #68
@jhnns
Copy link
Member

jhnns commented Oct 3, 2018

Shipped with v3.0.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants