Clean Code = Calm Mind
🚨 Important: Make sure that you have the VSCode plugins installed for both Prettier and ESLint, otherwise all of this is for naught!
No surprise here. We use Prettier to format our code and keep our preferences in the .prettierrc
file located in the root of R&P.
Cracking open this simple file will show that we follow the Prettier defaults with two exceptions:
We prefer using single quotes
over double quotes
.
We don't use semicolons. 😱😱😱
Having these preferences in the root of every R&P project will ensure consistent formatting for our all of our team members.
The formatting should occur automatically when you save your file. If that's not happening, open your VS code settings.json
and add this line:
"editor.formatOnSave": true,
We use ESLint as our linter and have an .eslintrc.json
file in the root of every R&P project that contains
our customized linting rules. This is rarely (if ever) modified.
We also have an .eslintignore
file that contains folders exempt from the rules, such
as public
and static
.