Most of the work to make the code look pretty can be automated and should not be done by humans.
Put the extension in VSCode.
Format all files.
$ npx prettier --write .
Automatic formatting when editing
- Cmd+Shift+P: Configure Language Specific Settings settings.json
Well, sometimes I don’t like it a bit, but I have to follow it honestly because it is barren to work hard on the configuration file to get it through.
--- old
$ npm install --save-dev prettier
$ ./node_modules/.bin/prettier --write src/*.ts
VSCode: prettier-vscode Cmd+Shift+P: Configure Language Specific Settings
settings.json
- Cmd+Shift+P: Prettier create config file
- Prettier config json
This page is auto-translated from /nishio/Prettier using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.