4 ms·
I'm not very familiar with JavaScript tools. Are there any good formatters that work similarly (parse the code and work from the AST) but are not so opinionated
by tzs 9y ago
I'm not very familiar with JavaScript tools. Are there any good formatters that work similarly (parse the code and work from the AST) but are not so opinionated?
What I want out of code formatters (for any language, not just JavaScript) is flexible configuration so that I can set up two configurations.
1. A configuration that outputs the style that my employer or the project I'm contributing to has standardized on.
2. A configurations that outputs the style that I prefer.
I picked my styles in the languages I use because they make the code easier to read for me. If the company or project standard style is different I'll be more productive if I can convert my copy to my style while I work on it.
- saranshk 9y agoThe opinionated formatting is what makes prettier great. A lot of configuration can be confusing for people to go through and pick a standard
- tzs 9y agoCouldn't a configurable formatter ship with preset configurations for the major styles used for each language? For most people, who are probably using one of a handful of common styles, configuration would just consist of setting one option.