Skip to content

Upgrade prettier & use --check option

Paul Gascou-Vaillancourt requested to merge upgrade-prettier into master

This MR attempts to address #227 (closed)

A --check option was first introduced in Prettier v1.16.0. According to the doc, this option

will output a human-friendly message and a list of unformatted files, if any.

Here's a sample output:

documentation/components/example_explorer.vue
documentation/components/jsfiddle_button.vue
tests/components/base/datepicker.spec.js
Code style issues found in the above file(s). Forgot to run Prettier?
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Thus, Prettier has been upgraded to its latest version, which will make the --check option available to us, and the CI job has been modified so that it runs with that option instead of --list-different.

Additionally, related NPM scripts have been renamed to make them more consistent with ESLint and Stylelint scripts:

  • prettier-all becomes prettier
  • prettier-all-save becomes prettier:fix

Since upgrading Prettier introduces new formatting rules, all formatting errors have been fixed in a follow up MR to reduce noise in this one: !743 (merged)

Closes #227 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports

Loading