Skip to content

Commit 5f6948c

Browse files
authored
fix: Fix a build error and add a make check (#102)
Make sure that our CI runs eslint. The generate job caught some `prefer-const` errors, which we should be able to find before a merge to main.
1 parent 3c4a608 commit 5f6948c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
node-version: 18
2626
- name: Install dependencies
2727
run: make install
28+
- name: Run linter
29+
run: make check
2830
- name: Run unit tests
2931
run: make test-unit
3032

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ install:
2222
build:
2323
npm run build
2424

25+
## check: lint the client
26+
.PHONY: check
27+
check:
28+
npx eslint src/
29+
2530
#############
2631
# Test #
2732
#############

src/hooks/custom/utils/form.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ export function getSplitPdfPageRange(formData: FormData, maxPages: number): [num
9292
const formDataParameter = formData.get(PARTITION_FORM_SPLIT_PDF_PAGE_RANGE_KEY);
9393
const pageRange = String(formDataParameter).split(",").map(Number)
9494

95-
let start = pageRange[0] || 1;
96-
let end = pageRange[1] || maxPages;
95+
const start = pageRange[0] || 1;
96+
const end = pageRange[1] || maxPages;
9797

9898
if (!(start > 0 && start <= maxPages) || !(end > 0 && end <= maxPages) || !(start <= end)) {
9999
const msg = `Page range (${start} to ${end}) is out of bounds. Values should be between 1 and ${maxPages}.`;

0 commit comments

Comments
 (0)