Prettier is an opinionated code formatter.




Node.js Versions

Supported Languages

CSS HTML JavaScript Markdown TypeScript

Official Documentation

YAML Configuration


  • input:

    Patterns to include in execution and reports.

  • ignore:

    Patterns to exclude from execution and reports.

  • auto-fix:


    Specifying true implies --write option.

  • config-file:

    Alias of --config option.

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.25 CPU with 960 MiB RAM.

  • options:

    Below is the list of options that are supported:

    Format options:
      --arrow-parens <avoid|always>
                              Include parentheses around a sole arrow function parameter.
                              Defaults to avoid.
      --no-bracket-spacing     Do not print spaces between brackets.
      --end-of-line <auto|lf|crlf|cr>
                              Which end of line characters to apply.
                              Defaults to auto.
      --html-whitespace-sensitivity <css|strict|ignore>
                              How to handle whitespaces in HTML.
                              Defaults to css.
      --jsx-bracket-same-line  Put > on the last line instead of at a new line.
                              Defaults to false.
      --jsx-single-quote       Use single quotes in JSX.
                              Defaults to false.
      --parser <flow|babylon|typescript|css|less|scss|json|json5|json-stringify|graphql|markdown|mdx|vue|yaml|html|angular>
                              Which parser to use.
      --print-width <int>      The line length where Prettier will try wrap.
                              Defaults to 80.
      --prose-wrap <always|never|preserve>
                              How to wrap prose.
                              Defaults to preserve.
      --no-semi                Do not print semicolons, except at the beginning of lines which may need them.
      --single-quote           Use single quotes instead of double quotes.
                              Defaults to false.
      --tab-width <int>        Number of spaces per indentation level.
                              Defaults to 2.
      --trailing-comma <none|es5|all>
                              Print trailing commas wherever possible when multi-line.
                              Defaults to none.
      --use-tabs               Indent with tabs instead of spaces.
                              Defaults to false.
    Config options:
      --config <path>          Path to a Prettier configuration file (.prettierrc, package.json, prettier.config.js).
      --no-config              Do not look for a configuration file.
      --config-precedence <cli-override|file-override|prefer-file>
                              Define in which order config files and CLI options should be evaluated.
                              Defaults to cli-override.
      --no-editorconfig        Don't take .editorconfig into account when parsing configuration.
      --ignore-path <path>     Path to a file with patterns describing files to ignore.
                              Defaults to .prettierignore.
      --with-node-modules      Process files inside 'node_modules' directory.
    Other options:
      --insert-pragma          Insert @format pragma into file's first docblock comment.
                              Defaults to false.
      --require-pragma         Require either '@prettier' or '@format' to be present in the file's first docblock comment
                              in order for it to be formatted.
                              Defaults to false.

YAML Examples

  • With default options:

      prettier: default
  • With enabling auto-fixing and default options:

      prettier: auto-fix
  • With custom machine:

          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
  • With custom options:

          --print-width: 120
          --tab-width: 4

Configuration File Detection

If no configuration files are specified via config-file or options field, Inspecode lets Prettier to find configuration files in your repository.

See about how Prettier looks for configuration files.

results matching ""

    No results matching ""