javascript prettier config code example

Example 1: prettier don't format line

// prettier-ignore						JS
{/* prettier-ignore */}					JSX
<!-- prettier-ignore -->				HTML / Markdown
/* prettier-ignore */					CSS

Example 2: run prettier

npx prettier --write path/to/my/file.html

Example 3: how to edit /.prettierrc.json file pretter

{
    "trailingComma": "none",
    "tabWidth": 4,
    "semi": true,
    "singleQuote": true
}

Example 4: prettierrc

{
  "trailingComma": "es5",
  "tabWidth": 4,
  "semi": false,
  "singleQuote": true
}