From ca805218208ada3667969668b51f94b8270a31ee Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Fri, 14 May 2021 10:53:38 -0700 Subject: [PATCH] ci: use prettier to format yml files (#42136) Use prettier to format all yml files in the repo via the ng-dev format tooling. PR Close #42136 --- .ng-dev/format.ts | 5 +++++ .prettierrc | 9 +++++++++ package.json | 1 + yarn.lock | 6 +++++- 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .prettierrc diff --git a/.ng-dev/format.ts b/.ng-dev/format.ts index e33f60d4af..c56366c57f 100644 --- a/.ng-dev/format.ts +++ b/.ng-dev/format.ts @@ -4,6 +4,11 @@ import {FormatConfig} from '../dev-infra/format/config'; * Configuration for the `ng-dev format` command. */ export const format: FormatConfig = { + 'prettier': { + 'matchers': [ + '**/*.{yaml,yml}', + ] + }, 'clang-format': { 'matchers': [ '**/*.{js,ts}', diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..d73829a932 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "printWidth": 100, + "tabWidth": 2, + "tabs": false, + "singleQuote": true, + "semicolon": true, + "quoteProps": "preserve", + "bracketSpacing": false +} diff --git a/package.json b/package.json index d997f2a5a2..3bafee8319 100644 --- a/package.json +++ b/package.json @@ -194,6 +194,7 @@ "mutation-observer": "^1.0.3", "nock": "^13.0.3", "ora": "^5.0.0", + "prettier": "^2.3.0", "rollup-plugin-hashbang": "^2.2.2", "sauce-connect": "https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz", "semver": "^7.3.5", diff --git a/yarn.lock b/yarn.lock index d883993d8b..81f68030a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10800,6 +10800,11 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" + integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== + pretty-bytes@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" @@ -11880,7 +11885,6 @@ sauce-connect-launcher@^1.2.4: "sauce-connect@https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz": version "0.0.0" - uid "7b7f35433af9c3380758e048894d7b9aecf3754e" resolved "https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz#7b7f35433af9c3380758e048894d7b9aecf3754e" saucelabs@^1.5.0: