Using Prettier to Make Development Less Cringeworthy
development·@leprechaun·
0.000 HBDUsing Prettier to Make Development Less Cringeworthy
After convincing @good-karma that prettier was a good idea, I find that trying to merge in new changes from Ecency code base into my forked version got me into a very large number of conflicts. I have revised my ideas on the matter. Whereas you can set prettier to *remove* semicolons whenever possible, you cannot set it to *add* semicolons. You can set it to change quotes to single-quote but not the other way around. Does it add semicolons by default? Now prose may be wrapped in all kinds of different ways. I'd use single quotes rather than double quotes. Now if you force the changes, no matter what rules you choose roughly 100 000 lines of code get changed when calling prettier. |Use tabs|Indent size| Arrow parens | Bracket spacing |Change Count| |------------|------------|--| ------------| ------------| | False | 2 | always|no | 112 986 | | True | 2 | always|no | 97 310 | | True | 4 |always |no | 100 992 | | True | 2 |avoid |no | 97 298 | | True | 2 |avoid |no | 97 298 | | True | 2 |avoid |yes | 97 135 | I have come to the conclusion that Ecency-vision, the source code of Ecency, shouldn't use prettier by running it on all changed files. However, by leveraging another program to run prettier on *only new lines*, overtime it could unburden the developer from coding convention concerns without causing conflicts on existing forks. I think semicolons should always be at the end of the line. If you add a line after a line that doesn't have one, you then must add the semicolon. Now you have changed one line as well as added. I used to think one should reformat these to some standard, and although it might help down the road, present forks will have too many conflicts to justify the problems that will be caused as a result. As of now, I'd only automatically format new lines if I could do so in a time efficient way. Rather than reindent when you put something in a try/catch block, use half an indent value. Single quotes and backquotes only need one keystroke without a shift-key. That's why I like to use that when I code. I don't really care if a program changes it to double quote for me after the fact. 
👍 joeyarnoldvn, reverendrum, academician, fatman, voter002, eturnerx-dbuzz, rumors, terminado, pdq, qubes, curatorcat.pal, hijosdelhombre, good-karma, saintopic, atexoras, machroezar, dodolzk, firman, dylanhobalart, penderis, smokingfit, mammasitta, mini-zephalexia, melinda010100, rt395, vikbuddy, trostparadox, xyba, photographercr, anacristinasilva, mineopoly, mcsagel, artjohn, pobscholarship, phusionphil, memepress, zelegations, cerberus-dji, hive-vpn, timhorton, steemvpn, hivecannabis,