Skip to content

chore(format): make eslint and prettier agree, then clear the debt in one pass #280

Description

@xenodeve

PRD: #275 · Blocks the "make lint required" issue.

EN

lint cannot become a check while three things are true at once:

  • nestjs's lint script is eslint --fix — it rewrites the working tree, so running it is a mutation, not a check. It is why 484 files sit permanently modified and why every commit needs manual path-intersection to avoid staging unrelated churn.
  • bunx prettier --check fails on 204 files at HEAD, so the tree has never been prettier-formatted.
  • eslint --fix and the standalone prettier config format differently, so the two disagree and running either dirties the other's work.

Acceptance criteria

  • One formatter of record is chosen and the two configurations are made to agree — verified by running both and observing no diff.
  • lint (check, no writes) is split from lint:fix in both workspaces, and the root lint uses the checking form.
  • One formatting-only PR clears the debt across the repository. It contains no behavioural change, stated in its body so review can be a spot check rather than a line-by-line read.
  • The pre-existing no-base-to-string errors in missing-column.ts and the pg-*.store.ts files are fixed as part of this, not left as a reason to keep the check off.
  • After the pass, bun run lint at the root exits zero on a clean checkout and leaves git status unchanged — asserted, because "it does not write" is the whole point.
  • bun test green in both workspaces afterwards; a formatting pass must not change behaviour.

Not in scope: making lint a required check (its own issue, immediately after this one).

TH

PRD: #275 · บล็อกอิชชู "ทำให้ lint เป็น required"

lint กลายเป็น check ไม่ได้ตราบใดที่สามข้อนี้จริงพร้อมกัน:

  • script lint ของ nestjs คือ eslint --fix — มัน เขียนทับ working tree ฉะนั้นการรันมันคือการแก้ไข ไม่ใช่การตรวจ · เป็นเหตุที่ไฟล์ 484 ไฟล์ค้างสถานะ modified ถาวร และเป็นเหตุที่ทุก commit ต้องตัดกับ path ด้วยมือเพื่อเลี่ยงการ stage ของที่ไม่เกี่ยว
  • bunx prettier --check ล้ม 204 ไฟล์ที่ HEAD ฉะนั้น tree ไม่เคยถูกฟอร์แมตด้วย prettier เลย
  • eslint --fix กับ prettier config ที่แยกอยู่ ฟอร์แมตต่างกัน ฉะนั้นทั้งสองขัดกันและการรันอันใดก็ทำให้งานของอีกอันเปื้อน

เกณฑ์การยอมรับ

  • เลือกตัวฟอร์แมตที่ถือเป็นทางการหนึ่งตัว และทำให้สองคอนฟิกตรงกัน — ยืนยันด้วยการรันทั้งคู่แล้วไม่เกิด diff
  • แยก lint (check ไม่เขียน) ออกจาก lint:fix ในทั้งสอง workspace และ lint ที่ root ใช้รูปแบบที่ตรวจอย่างเดียว
  • PR ฟอร์แมตล้วนหนึ่งอันล้างหนี้ทั้งรีโป · มัน ไม่มี การเปลี่ยนพฤติกรรมใด ระบุไว้ในเนื้อ PR เพื่อให้การรีวิวเป็นการสุ่มตรวจ ไม่ใช่การอ่านทีละบรรทัด
  • error no-base-to-string ที่มีมาก่อนใน missing-column.ts และไฟล์ pg-*.store.ts ถูกแก้เป็นส่วนหนึ่งของงานนี้ ไม่ใช่ถูกทิ้งไว้เป็นเหตุผลให้ปิด check ต่อ
  • หลังผ่านรอบนี้ bun run lint ที่ root คืนศูนย์บน checkout ที่สะอาดและทำให้ git status ไม่เปลี่ยน — assert ไว้ เพราะ "มันไม่เขียนไฟล์" คือประเด็นทั้งหมด
  • bun test ผ่านทั้งสอง workspace หลังจากนั้น · การจัดฟอร์แมตต้องไม่เปลี่ยนพฤติกรรม

ไม่อยู่ในขอบเขต: การทำให้ lint เป็น required check (อิชชูของตัวเอง ถัดจากอันนี้ทันที)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions