Comments (4)
I just realized that some of the changes I was going to make were already taken care by you during a previous release, so there's not a lot to fix anymore.
At this point I think you can change it yourself next time you touch the code.
Have a good night.
from pretty-print-json.
The concept of prettier is great, but the style choices result in code that is uglier than mud. Prettier is really geared towards procedural programing and makes a mess of functional code. Alignment is destroyed. Clean, simple ternary assignments are expanded into bulky multiline blocks. It assumes if
statements will have multiline blocks.
Of course, some people like the style decisions of prettier, and the library is very upfront that it's opinionated.
The whitespace in pretty-print-json follows a very specific pattern. Think of blocks of code indented like a hanging paragraph or like the JS equivalent of Python. The advantage is that you can see where the block ends without analyzing the content of the code. In the typical indentation used in most JS code you see, you cannot always tell if a line of code starts a new block without first interpreting the code.
from pretty-print-json.
Ok fair enough, I understand if you want to keep it this way.
The problem now however, is that the style you describe is not consistent throughout the codebase (my contributions have followed a different style for example). I would have gladly changed this if you mentioned it before merging my PRs.
If you still want me to fix the inconsistencies let me know, otherwise you can close this issue if you'd like to leave it like it is now 👍
from pretty-print-json.
If you want to put up another PR, go for it.
Sometimes the back-and-forth on PRs is too much effort compared to just updating the style next time I'm editing the code. I submit a number of issues to give people an opportunity to contribute and learn about open source. I don't get too fussy about PRs since I just do it for fun.
from pretty-print-json.
Related Issues (20)
- Make links clickable HOT 1
- Add support for JSON5 HOT 1
- Upgrade to ES6 spread operator to merge options
- Travis/Azure/Actions pipeline?
- Switch to trailing comma style in spec/mocha.js HOT 3
- Switch to ES6 object method shorthand in spec/interactive.html
- Add JSHint rule to disallow var declarations HOT 1
- Add JSHint rule to disallow invalid space characters
- 0.4.3 and 0.4.4 are broken for dynamic import HOT 2
- add changelog HOT 2
- Undefined import: prettyPrintJson HOT 6
- Add Line number support HOT 9
- Option to enable more compact layout for small objects and arrays HOT 3
- Trouble with properly formatting array in JSON object HOT 2
- Key order not preserved HOT 2
- URL query param support HOT 1
- Toggle dark mode with `prefers-color-scheme` by default
- Add Option for linkUrls for target='_blank' HOT 1
- Polyfill support for String.prototype.at HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pretty-print-json.