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

Add forceformat option #27

Merged
merged 3 commits into from Dec 16, 2012
Merged

Conversation

lroggendorff
Copy link
Contributor

Howdy,

Using jsonlint.com, I got used to the behavior that it goes ahead and formats the source even if errors are found. When I started using the jsonlint cli, I noticed that behavior was missing. It seemed like it might be nice to include, so I thought I'd give it a shot. I've just taken Chris Dary's char-by-char formatter and inserted it. I'm hoping that's cool, or that you and he can work it out one way or the other. :)

Also, while working on this, I noticed a variable name wasn't updated properly in cli.js. That change is included in this PR, or I've also created a branch specifically for that change, so I could send a separate PR if you'd rather.

Cheers,
Lance

It looks like at one time the variable referencing the input file was
'path', and later on it was changed to 'json', but the if
(options.inplace) block was never updated.
When using jsonlint.com, even invalid JSON is pretty printed. It seemed
like a good option to have in the cli version as well. This is simply
inserting the char-by-char formatter from
https://github.com/umbrae/jsonlintdotcom and adding an option to cli.js.
* fix-inplace-overwriting:
  Fixing variable name when overwriting input file.
zaach added a commit that referenced this pull request Dec 16, 2012
@zaach zaach merged commit 79b553f into zaach:master Dec 16, 2012
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

Successfully merging this pull request may close these issues.

None yet

3 participants