Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/pr-check-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR Lint Test

on:
pull_request:
branches:
- main

jobs:
lint-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v7.0.1

- name: Set up Node.js
uses: actions/setup-node@v7.0.0
with:
node-version: 25

- name: Install dependencies
run: npm install

- name: Run lint
env:
CI: false
run: npm run lint
5 changes: 0 additions & 5 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ jobs:
- name: Install dependencies
run: npm install

- name: Run lint
env:
CI: false
run: npm run lint

- name: Run build
env:
CI: false
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,50 @@ on:
push:
branches:
- main

concurrency:
group: prettier-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref || github.ref_name }}

- uses: actions/setup-node@v7.0.0
- run: |
npm ci
npx prettier --write .
with:
node-version: "26"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Run Prettier
run: npx prettier --write .

- run: |
if git diff --cached --name-only | grep -q '^\.github/'; then
echo "Error: prettier attempted to modify files in .github directory"
- name: Block changes to .github/
run: |
if git diff --name-only | grep -q '^\.github/'; then
echo "Error: Prettier attempted to modify files in .github/"
git diff --name-only | grep '^\.github/'
exit 1
fi

- run: |
- name: Commit formatted files
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff --cached --exit-code || git commit -m "chore: Apply Prettier format"
git diff --cached --exit-code || git commit -m "chore: apply Prettier formatting"

- run: |
- name: Push changes
run: |
git pull --rebase origin ${{ github.head_ref || github.ref_name }}
if [ "${{ github.event_name }}" == "pull_request" ]; then
git push origin HEAD:refs/heads/${{ github.head_ref }}
Expand Down
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ const eslintConfig = defineConfig([
"public/_pagefind/**",
"src/.source/**",
]),
{
settings: {
// Fix for ESLint 10+: eslint-plugin-react uses context.getFilename() (legacy API)
// which was removed in ESLint 10 flat config. Declaring the version explicitly
// prevents the plugin from trying to auto-detect it and failing.
react: { version: "19" },
},
},
]);

export default eslintConfig;
Loading
Loading