From the course: CSS: Refactoring Style Sheets

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Install and configure Prettier

Install and configure Prettier - CSS Tutorial

From the course: CSS: Refactoring Style Sheets

Start my 1-month free trial

Install and configure Prettier

- [Instructor] Stylelint and the stylint config standard configuration we installed, impose a very strick set of coding standards and formatting rules on our code and tells us to adhere to it. Which is fine when you're writing new code, but not a lot of fun when you have to refactor hundreds or even thousands of lines of code. Ideally, stylelint would fix these errors for us automatically, and it can though that requires you to use the command line, and that can be a bit of a hassle to get it to work properly. To work around this problem, we can seek out the help of Prettier. A tool specifically designed to reformat code, JavaScript, and css in particular, to fit what ever configuration we give it. In other words, we can get Prettier and stylelint to work together to find and fix errors, and reformat our code to fit consistent property order et cetera, et cetera. The first step to get this to work, is to install Prettier. And we do this the same way we've installed everything else so…

Contents