Prettier

Prettier is an opinionated code formatter.

Version

1.5.3

Runtime

Node.js Versions

Supported Languages

CSS JavaScript TypeScript

Official Documentation

https://github.com/prettier/prettier

YAML Configuration

prettier:

  • input:

    Patterns to include in execution and reports.

  • ignore:

    Patterns to exclude from execution and reports.

  • auto-fix:

    true/false

    Specifying true implies --write option.

  • config-file:

    N/A

  • 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:

    --print-width <int>      Specify the length of line that the printer will wrap on. Defaults to 80.
    --tab-width <int>        Specify the number of spaces per indentation-level. Defaults to 2.
    --use-tabs               Indent lines with tabs instead of spaces.
    --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.
    --no-bracket-spacing     Do not print spaces between brackets.
    --jsx-bracket-same-line  Put > on the last line instead of at a new line.
    --trailing-comma <none|es5|all>
                             Print trailing commas wherever possible. Defaults to none.
    --parser <flow|babylon|typescript|postcss|json>
                             Specify which parse to use. Defaults to babylon.
    --with-node-modules      Process files inside `node_modules` directory.

YAML Examples

  • With default options:

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

    inspecode:
      prettier: auto-fix
  • With custom machine:

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

    inspecode:
      prettier:
        options:
          --print-width: 120
          --tab-width: 4

results matching ""

    No results matching ""