3 ms·
What are everyone's strategies to adopt a tool like this? Do people run prettier over their entire codebase in one PR and call it a day?
by adenta 9y ago
What are everyone's strategies to adopt a tool like this? Do people run prettier over their entire codebase in one PR and call it a day?
- jbrooksuk 9y agoSeriously, try out https://StyleCI.io https://StyleCI.io it runs automatically Prettier on any branch you wish (can be disabled). Plug: I make StyleCI.
- saranshk 9y agoFormatting per file/directory is a feasible solution. Another approach could be that you integrate it in your editor, and on every file that you work, on pressing save, it gets formatted. Thus you can convert it file by file. If you do it all at once, it would be a big diff and blame will always point to that commit and you would have some problems because of it
- laurent123456 9y ago> Another approach could be that you integrate it in your editor, and on every file that you work, on pressing save, it gets formatted. Thus you can convert it file by file. It means that your actual changes will be lost in a big diff of cosmetic changes. I think a better option is to convert the whole codebase in one commit and only after that run it on file save.
- adenta 9y agoDo you have experience doing this? We are worried that one can't feesable click test an entire applications worth of prettier changes in a single PR.
- saranshk 9y agoSince prettier formats using the javascript AST, it should not introduce any bugs.
- laurent123456 9y agoI've applied it to this app at some point: https://github.com/laurent22/joplin https://github.com/laurent22/joplin And didn't notice any bug or any issue in any of the three apps and all the tests were still passing.
- 11235813213455 9y agoeditor.formatOnSave setting on vscode