diff --git a/.github/workflows/prettier-lint.yml b/.github/workflows/prettier-lint.yml new file mode 100644 index 0000000000..c7b0486659 --- /dev/null +++ b/.github/workflows/prettier-lint.yml @@ -0,0 +1,23 @@ +name: Lint JS files with Prettier + +# This action works with pull requests and pushes +on: + pull_request: + push: + branches: + - main + +jobs: + prettier: + runs-on: ubuntu-latest + continue-on-error: true + + steps: + - uses: actions/checkout@v2 + + - name: Check for prettified code + uses: creyD/prettier_action@v4.3 + with: + dry: True + # This part is also where you can pass other options, for example: + prettier_options: docs/**/*.md diff --git a/package-lock.json b/package-lock.json index 6368fde74c..9bd6d486db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "autoprefixer": "^10.4.13", "postcss": "^8.3.7", "postcss-cli": "^9.1.0", - "prettier": "3.0.3" + "prettier": "^3.0.3" } }, "node_modules/@nodelib/fs.scandir": { diff --git a/package.json b/package.json index 6f794939ea..6f2585b2d3 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,6 @@ "autoprefixer": "^10.4.13", "postcss": "^8.3.7", "postcss-cli": "^9.1.0", - "prettier": "3.0.3" + "prettier": "^3.0.3" } }