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",