Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

prettier 3.2.5

Prettier is an opinionated code formatter
Package summary
Share
0
issues
0
licenses
Package created
10 Jan 2017
Version published
4 Feb 2024
Maintainers
11
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does prettier do?

Prettier is an opinionated code formatter that helps to enforce a consistent coding style across a project. It achieves this by parsing your code and re-printing it with its own rules, taking into account the maximum line length and wrapping code where necessary. The versatile tool supports various languages, including JavaScript, TypeScript, CSS, SCSS, HTML, Vue, Angular, and many more. By championing streamlined and clean code, Prettier not only enhances code readability but also minimizes the time developers spend on code review.

How do you use prettier?

You can use Prettier in several ways. One common method is to run it in your code editor every time you save changes. This ensures that every piece of code you write adheres to the same style. For instance, if you have a long line of code like the one below:

foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());

Applying Prettier would automatically reformat it in a more readable format:

foo(
  reallyLongArg(),
  omgSoManyParameters(),
  IShouldRefactorThis(),
  isThereSeriouslyAnotherOne(),
);

You can also configure Prettier to run in a pre-commit hook or in CI environments, offering another chance to standardize the code style across your codebase before any changes are committed or deployed.

Where are the prettier docs?

For a comprehensive guide on how to use Prettier, delve into the official Prettier documentation. Here, you'll find everything from how to install the package, customize the options, leverage the Command Line Interface (CLI) and API, and much more. There's also a dedicated Playground page where you can test and play around with Prettier.