-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Integrate Prettier, the opinionated code formatter with support for many languages and integrations with most editors. It ensures that all outputted code conforms to a consistent style.
Configuration
This is one of the main features of Prettier: It already provides the best and recommended style configurations of-out-the-box™.
The only option we will change is the print width. It is set to 80 by default which not up-to-date for modern screens (might only be relevant when working in terminals only like e.g. with Vim). It'll be changed to 120 used by all of Arctic Ice Studio's style guides.
The prettier.config.js configuration file will be placed in the project root as well as the .prettierignore file to also define ignore pattern.
NPM script/task
To allow to format all sources a format:pretty npm script/task will be added to be included in the main format script flow.
Tasks
- Install prettier package.
- Implement
prettier.config.jsconfiguration file. - Implement
.prettierignoreignore pattern file. - Implement NPM
format:prettyscript/task. - Format current code base for the first time and fix possible style guide violations using the configured linters of the project.
