Kaynağa Gözat

Added prettierignore and check script

Torkel Ödegaard 6 yıl önce
ebeveyn
işleme
ac9129c2b7
3 değiştirilmiş dosya ile 12 ekleme ve 6 silme
  1. 8 0
      .prettierignore
  2. 3 6
      package.json
  3. 1 0
      scripts/circle-test-frontend.sh

+ 8 - 0
.prettierignore

@@ -0,0 +1,8 @@
+.git
+.github
+dist/
+pkg/
+node_modules
+public/vendor/
+vendor/
+

+ 3 - 6
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"
     ],

+ 1 - 0
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