Skip to content

Upgrade prettier to v1.15.2

Mike Greiling requested to merge mg-upgrade-prettier into master

What does this MR do?

Upgrades prettier to the latest version which adds Vue template support.

Prettier's opinionated formatting conflicts with (or makes redundant) the following eslint-plugin-vue rules which have been disabled:

  • vue/html-closing-bracket-newline
  • vue/html-closing-bracket-spacing
  • vue/html-indent
  • vue/max-attributes-per-line

Example changes

The diff on this MR loads slowly so here's a representative example.
Screen_Shot_2018-11-19_at_3.15.38_PM

VSCode warning

NOTE: The VSCode Vetur extension which adds linter/formatter support to .vue files has not been updated to recognize prettier 1.15.2. If you with to have prettier auto-format vue files on save, you'll need to add the following to your user config, to disable the formatter options in Vetur and enable them in Prettier:

{
  "vetur.format.defaultFormatter.html": "none",
  "vetur.format.defaultFormatter.css": "none",
  "vetur.format.defaultFormatter.postcss": "none",
  "vetur.format.defaultFormatter.scss": "none",
  "vetur.format.defaultFormatter.less": "none",
  "vetur.format.defaultFormatter.stylus": "none",
  "vetur.format.defaultFormatter.js": "none",
  "vetur.format.defaultFormatter.ts": "none",
  "prettier.disableLanguages": []
}
Edited by Mike Greiling

Merge request reports