Support JSON file formatting?
See original GitHub issueNot 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:
- Created 7 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Shameless plug: https://github.com/lydell/json-stringify-pretty-compact
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.