From the course: Angular: Workflows

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Installing and Configuring Prettier

Installing and Configuring Prettier - Angular Tutorial

From the course: Angular: Workflows

Installing and Configuring Prettier

- [Instructor] We will now be taking a look at how we can integrate Prettier in an Angular project. Prettier is an opinionated code formatter that has been making developers happy by having their code magically formatted in a clean, consistent style. Ensuring clean, formatted code should definitely be a part of your work flow. And you may not know it, but Prettier has TypeScript support. That means you can easily integrate it into your Angular project, however, there's TSLint, so how the two work together? It's simple, we can leave the code quality rules for TSLint to handle, and we can have Prettier take care of formatting rules. Let's go ahead and install Prettier. Set out to our project here, and npm install -D prettier. Next we need to configure Prettier. Let's look at some of the defaults that Prettier has. The print width is 80. It uses two spaces and not tabs. Semicolons. Single quotes. No trailing commas, and bracket spacing. If you don't provide a configuration file, it will…

Contents