From 36b1ef11073249dace01a28a9a51a77c6f9b6771 Mon Sep 17 00:00:00 2001 From: MGJamJam Date: Wed, 24 Jul 2024 15:12:51 -0300 Subject: [PATCH] add format script and prettierignore --- .github/workflows/ci.yml | 4 +++- .prettierignore | 5 +++++ package.json | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .prettierignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ec3bf3..5dbcb60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [push] +on: [ push ] permissions: read-all @@ -25,6 +25,8 @@ jobs: - name: Check types run: yarn run typecheck + - name: Check formatting + run: yarn run format:check - name: Lint run: yarn run lint - name: Unit tests diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..dc24fe6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +# Ignore artifacts +dist + +# Ignore files created by `@grafana/create-plugin` +.config diff --git a/package.json b/package.json index b7b66f8..0046b51 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "typecheck": "tsc --noEmit", "lint": "eslint --cache --ignore-pattern 'dist/**' --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .", "lint:fix": "yarn run lint --fix", + "format": "yarn prettier . --write", + "format:check": "yarn prettier --check .", "e2e": "yarn exec cypress install && yarn exec grafana-e2e run", "e2e:update": "yarn exec cypress install && yarn exec grafana-e2e run --update-screenshots", "server": "docker-compose up --build",