Skip to content

chore(deps): upgrade eslint and @eslint/js to 10, attach error causes - #307

Merged
jinon86 merged 1 commit into
mainfrom
chore/eslint-10-upgrade
Aug 10, 2026
Merged

chore(deps): upgrade eslint and @eslint/js to 10, attach error causes#307
jinon86 merged 1 commit into
mainfrom
chore/eslint-10-upgrade

Conversation

@jinon86

@jinon86 jinon86 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

#305(eslint 9.39.4→10.8.0)과 #304(@eslint/js 9.39.4→10.0.1)를 대체합니다. 두 PR은 결합돼 있어 따로 올릴 수 없습니다.

왜 결합 PR인가

로컬에서 Node 24(CI와 동일)로 세 조합을 각각 검증한 결과입니다:

조합 lint
#305만 (eslint 10 + @eslint/js 9) PASS — 단 false green
#304만 (eslint 9 + @eslint/js 10) FAIL (17건)
둘 다 (실제 목표 상태) FAIL (17건)

#305가 단독으로 통과하는 건 @eslint/js@9의 recommended가 신규 규칙을 켜지 않기 때문입니다. 그 상태로 머지하면 반쪽 업그레이드가 되고, 나중에 #304를 올리는 순간 같은 17건이 그대로 터집니다.

17건은 eslint --fix0건 해결됩니다(전부 수동).

처리 방식

preserve-caught-error 6건 — 수정했습니다.
전부 catch에서 래퍼 Error를 재throw하면서 원본을 연결하지 않아, 실제 parse/IO 실패가 체인에서 사라지던 자리입니다. { cause }를 붙였습니다.

  • scripts/competition-validity.js, scripts/dry-run-execute.js, scripts/dry-run-gates.js, scripts/round.js, scripts/validate.js(2곳)

no-useless-assignment 11건 — 규칙을 껐습니다.
지적된 자리는 전부 let ok = false / let detail = ''처럼 switch나 try/catch 앞에서 방어적으로 초기화하는 패턴입니다. 규칙대로 초기값을 지우면 동작은 그대로인데, 나중에 분기 하나가 할당을 빠뜨렸을 때 undefined가 새는 구조로 바뀝니다. 기능 이득 0 / 취약성 증가라 판단해 스타일을 보존하고 eslint.config.js에 사유 주석과 함께 off 처리했습니다.

  • 해당 위치: dry-run-execute.js(4), live-runner.js(4), score.js(2), dry-run-gates.js(1)

억제가 아니라 수정임을 검증

npx eslint --print-config로 확인한 활성 상태:

preserve-caught-error    [2, {...}]   ← error 유지
no-useless-assignment    [0]          ← 유일하게 off
no-shadow / eqeqeq / prefer-const     ← 변경 없음

round.js에 위반을 일부러 되돌려 넣으니 preserve-caught-error가 그대로 1건을 잡았고, 원복 후 다시 통과했습니다.

검증

로컬 Node 24에서 CI 5단계 전부 재현 — 모두 PASS:

lint       PASS
format     PASS   (format:check)
unit       PASS   (test:unit)
test       PASS   (npm test)
ci-round   PASS   (make ci-round)

설치 확인: eslint@10.8.1 / @eslint/js@10.0.1 / globals@17.8.0 / prettier@3.9.6 / js-yaml@5.2.2

머지 후

#304와 #305는 superseded로 종료 예정입니다.

Supersedes the two coupled dependabot PRs (#305 eslint 9.39.4 -> 10.8.0,
#304 @eslint/js 9.39.4 -> 10.0.1). Neither can land alone: #304 alone fails
lint, and #305 alone passes only because @eslint/js 9's recommended config
does not yet enable the new rules, so it would be a half upgrade that breaks
the moment #304 follows.

Together the two bumps surface 17 errors from two rules newly enabled by
eslint:recommended in @eslint/js 10, none of them auto-fixable:

- preserve-caught-error (6) — fixed. Every site rethrows a wrapper Error from
  a catch without linking the original, so the underlying parse/IO failure was
  dropped from the chain. Now passes `{ cause }`.
- no-useless-assignment (11) — rule disabled in eslint.config.js. The flagged
  sites seed `let ok = false` / `let detail = ''` before a switch or try/catch
  so a branch that forgets to assign yields a safe default instead of
  `undefined`. Removing those initializers changes no behaviour and removes the
  guard, so the defensive style is kept and the rule is turned off with a
  comment recording why.

preserve-caught-error stays at error level and was confirmed to still fail on a
reintroduced violation, so this is a fix rather than a blanket suppression.

Verified locally on Node 24 (same as CI) by reproducing all five CI steps:
lint, format:check, test:unit, npm test, make ci-round — all pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@seoseo-ai seoseo-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after explicit operator authorization using the local seoseo-ai credential.

@jinon86
jinon86 merged commit 8a5e63d into main Aug 10, 2026
1 check passed
@jinon86
jinon86 deleted the chore/eslint-10-upgrade branch August 10, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants