From ac9129c2b75bb9a459389b42bf56fccd7fa62044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 13 Feb 2019 11:38:04 +0100 Subject: [PATCH] Added prettierignore and check script --- .prettierignore | 8 ++++++++ package.json | 9 +++------ scripts/circle-test-frontend.sh | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000000..b7a33870ddd --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ +.git +.github +dist/ +pkg/ +node_modules +public/vendor/ +vendor/ + diff --git a/package.json b/package.json index 36fdd794d0c..7dce5e04ea3 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,8 @@ "typecheck": "tsc --noEmit", "jest": "jest --notify --watch", "api-tests": "jest --notify --watch --config=tests/api/jest.js", - "storybook": "cd packages/grafana-ui && yarn storybook" + "storybook": "cd packages/grafana-ui && yarn storybook", + "prettier:check": "prettier -- --list-different \"**/*.{ts,tsx,scss}\"" }, "husky": { "hooks": { @@ -128,11 +129,7 @@ } }, "lint-staged": { - "*.{ts,tsx}": [ - "prettier --write", - "git add" - ], - "*.scss": [ + "*.{ts,tsx,json,scss}": [ "prettier --write", "git add" ], diff --git a/scripts/circle-test-frontend.sh b/scripts/circle-test-frontend.sh index 3af199d3ff2..cd42dd0b7e9 100755 --- a/scripts/circle-test-frontend.sh +++ b/scripts/circle-test-frontend.sh @@ -10,4 +10,5 @@ function exit_if_fail { fi } +exit_if_fail npm run prettier:check exit_if_fail npm run test