From 23e99e56e192617258eb26feddd758b9b0c56ad5 Mon Sep 17 00:00:00 2001 From: James Prado Date: Mon, 1 Jan 2018 18:51:18 -0500 Subject: [PATCH] Ensure CI fails on non-prettier compliant PRs (#693) --- .prettierrc | 3 +-- .travis.yml | 2 ++ package.json | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.prettierrc b/.prettierrc index ce3b78b2..0de7c6bb 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,6 +4,5 @@ "useTabs": false, "semi": true, "tabWidth": 2, - "trailingComma": - "none" + "trailingComma": "none" } diff --git a/.travis.yml b/.travis.yml index 6155a7b6..30f2115c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,8 @@ install: jobs: include: + - stage: test + script: npm run prettier:diff - stage: test script: npm run test - stage: test diff --git a/package.json b/package.json index a7614f90..29bbb579 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,10 @@ "tscheck": "tsc --noEmit", "start": "npm run dev", "precommit": "lint-staged", - "formatAll": "find ./common/ -name '*.ts*' | xargs prettier --write --config ./.prettierrc --config-precedence file-override", + "formatAll": + "find ./common/ -name '*.ts*' | xargs prettier --write --config ./.prettierrc --config-precedence file-override", + "prettier:diff": + "prettier --write --config ./.prettierrc --list-different \"common/**/*.ts\" \"common/**/*.tsx\"", "prepush": "npm run tslint && npm run tscheck" }, "lint-staged": {