Skip to content

Commit de2a98b

Browse files
committed
chore(ci): Configure eslint in CI
* Run `next lint` on pull requests
1 parent 4431a95 commit de2a98b

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

.github/workflows/test.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
IMAGES_HOSTNAME: "*"
8+
9+
jobs:
10+
next-lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup node
17+
uses: actions/setup-node@v6
18+
with:
19+
node-version: 22
20+
cache: yarn
21+
cache-dependency-path: next/yarn.lock
22+
23+
- name: Install eslint (for easier rebasing, could be added to packages.json later)
24+
working-directory: ./next
25+
run: yarn add --dev eslint-config-next 'eslint@^8'
26+
27+
- name: Install dependencies
28+
working-directory: ./next
29+
run: yarn install --frozen-lockfile
30+
31+
- name: Running linter
32+
working-directory: ./next
33+
run: yarn run next lint --output-file ../next-eslint_report.json --format json
34+
continue-on-error: true
35+
36+
- name: Annotate Code Linting Results
37+
uses: ataylorme/eslint-annotate-action@v3
38+
with:
39+
report-json: "next-eslint_report.json"
40+
only-pr-files: false
41+
continue-on-error: true

next/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["next", "next/typescript"]
3+
}

next/Dockerfile.prod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN \
2020

2121
# Rebuild the source code only when needed
2222
FROM base AS builder
23+
2324
WORKDIR /app
2425
COPY --from=deps /app/node_modules ./node_modules
2526
COPY . .
@@ -70,4 +71,4 @@ ENV HOSTNAME="0.0.0.0"
7071
CMD ["node", "server.js"]
7172

7273
COPY healthcheck.mjs ./healthcheck.mjs
73-
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s CMD node healthcheck.mjs
74+
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s CMD node healthcheck.mjs

next/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"private": true,
33
"scripts": {
44
"dev": "next dev",
5+
"lint": "next lint",
56
"build": "next build",
67
"start": "node .next/standalone/server.js",
78
"syncDataModel": "node bin/syncDataModel.js",

0 commit comments

Comments
 (0)