question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support JSON file formatting?

See original GitHub issue

Not sure if it’s a long shot or not, but would adding .json formatting be out of scope? Would it be difficult to add?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
lydellcommented, Jan 19, 2017
2reactions
jlongstercommented, Jan 19, 2017

Agreed, JSON does not have types like functions or binary expressions and so a simpler formatting (that doesn’t need the constraint-based solver here) works.

Although, I can see the case for wanting to use the same editor plugins to be formatting your package.json as you write it. The core issue is the top-level { problem. We’d need to disambiguate top-level blocks and force them into JS objects, which means we won’t allow top-level objects.

Or we could check if the filename ends in json and special case it.

I can see the it being annoying typing cmd+alt+f (or whatever in the rest of your project) but not being able to in JSON files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a JSON file? - File Format Docs
JSON (JavaScript Object Notation) is an open standard file format for sharing data that uses human-readable text to store and transmit data. JSON...
Read more >
JSON Tutorial: Learn with Simple File Format EXAMPLE
JSON is a file format used to store information in an organized and easy-to-access manner. Its full form is JavaScript Object Notation.
Read more >
How to format JSON
JavaScript Object Notation, or JSON, is a human-readable standardised file format. You can use JSON to add data points for processing in large...
Read more >
JSON File Extension - What is a .json file and how do I open it?
A JSON file is a file that stores simple data structures and objects in JavaScript Object Notation (JSON) format, which is a standard...
Read more >
JSON editing in Visual Studio Code
Formatting. You can format your JSON document using Ctrl+Shift+I or Format Document from the context menu. Folding. You can ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found