Skip to content

Commit

Permalink
Merge pull request #1820 from govuk-one-login/BAU/fix-pre-commit
Browse files Browse the repository at this point in the history
BAU: Use eslint and prettier from node_modules
  • Loading branch information
whi-tw authored Jul 11, 2024
2 parents 5e2b36c + e9ef2e4 commit 53cb0a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,27 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
name: Run pre-commit
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🏗️ Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"

- name: 🏗️ Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: 🏗️ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18.20.3"
cache: "yarn"
cache-dependency-path: "yarn.lock"

- name: Install dependencies
run: yarn install

- name: Run pre-commit
uses: pre-commit/action@v3.0.1
with:
Expand Down
11 changes: 2 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,11 @@ repos:
types_or:
- javascript
- ts
entry: eslint --fix
additional_dependencies:
- eslint@^8.57.0
- eslint-config-prettier@^9.1.0
- eslint-plugin-no-only-tests@^3.1.0
- eslint-plugin-prettier@^4.0.0
entry: yarn run eslint --fix
pass_filenames: true
- id: prettier
name: Run prettier
language: node
types: [text]
entry: prettier --write --ignore-unknown
additional_dependencies:
- prettier@^3.3.2
entry: yarn run prettier --write --ignore-unknown
pass_filenames: true

0 comments on commit 53cb0a0

Please sign in to comment.