Repository navigation
chore(os): ESLint flat config with slice-boundary rule and lint-staged pre-commit - #94
Conversation
5939866 to
2e2fbc7
Compare
|
Rebased onto current main (bb2d1ab + 2e2fbc7): absorbs #91's test:e2e script, the e2e lint:md excludes, and Playwright devDeps into package.json/package-lock.json; also lints playwright.config.ts via allowDefaultProject in eslint.config.mjs. lint 0 errors/13 warnings, typecheck exit 0 locally. Re-review requested. |
|
Friendly ping @Sullux - #94 (ESLint flat config + lint-staged pre-commit, issue #82) has been waiting on a review since 01:59Z. It was rebased onto current main (absorbs #91's e2e script + Playwright devDeps + lint:md excludes) and lints playwright.config.ts via allowDefaultProject. CI 4/4 green. Whenever you have a moment, it unblocks the 0.4 step of Phase 0. |
|
Rebased onto main (688046a, post-#103). Conflicts in app.vue/Taskbar.vue resolved in favor of main's mobile-shell markup (#100); ESLint config unchanged (allowDefaultProject for playwright.config.ts intact). |
2e2fbc7 to
bc37b56
Compare
m-vawter
left a comment
There was a problem hiding this comment.
Verified merged into current main in a clean container. Lint: 0 errors and 17 warnings. Typecheck passes, and the e2e suite passes 6/6. The hook works end to end:
- husky installs;
- a staged cross-slice import (
~/features/os/...from the chat slice) blocks the commit; - a fixable
.vuefile is reformatted byeslint --fix, and the fixed version is what gets committed; - each commit takes about 3 seconds.
Keeping vue-tsc in CI matches ADR 0002, which defers it from pre-commit. Approving. Follow-ups, none blocking:
-
Relative cross-slice imports pass the rule.
import { useOsStore } from '../../os/stores/os'inapp/features/chat/...lints clean, in.tsand.vuealike.no-restricted-importsmatches the specifier as written, not the resolved path, so the "plain relative forms" in the config comment aren't covered. Nothing on main does this today, so it's latent. A path-resolving rule would close it, such asimport-x/no-restricted-pathswith a zone per slice. -
The kernel path is
app/features/shared/, notapp/shared/. The exemption block and the error message both nameapp/shared/, which doesn't exist. So the message sends agents to a folder that isn't there. -
Records for Phase 0's "ADRs match the code":
- ADR 0002's as-built notes (lines 96–97 and 113–114) say the hook runs markdown linting only. After this it also runs ESLint on staged files.
- NEXT.md 0.4 still says pre-commit runs
vue-tsc.
Both are small edits, and I can draft them if Brandon wants.
-
Nits:
- the hook lints Markdown twice (
lint:mdon all files, then lint-staged's*.md); .husky/pre-commithas no trailing newline.
- the hook lints Markdown twice (
On review order: Charles's two files only get lint fixes, an SVG reflow and an unused variable, so I don't think this needs to wait on his lane review. Your call. Once it's in, could you add ESLint to main's required checks? It's the fifth CI job, and adding it keeps the gate complete.
Summary
Implements issue #82: ESLint flat config with a slice-boundary rule, lint-staged in pre-commit, and an ESLint job in CI. Completes the deferred "Future" gates from ADR 0002 (type-aware ESLint + enforcement in CI and pre-commit).
eslint.config.mjs(new):@eslint/js+ typescript-eslint (projectService, type-aware where possible) + eslint-plugin-vueflat/recommended. Ano-restricted-importsslice-boundary rule blocks cross-slice imports per ADR 0001, with exemptions for the composition root (app/app.vue), the shared kernel (app/features/shared/**), andserver/boundary usage.package.json:lint/lint:fixscripts;lint-stagedconfig (eslint --fix on JS/TS/Vue, markdownlint on MD)..husky/pre-commit: nownpm run lint:md+npx lint-staged..github/workflows/ci.yml: neweslintjob alongside markdownlint/typecheck/build.Deviation from the issue plan, declared per protocol:
vue-tscis NOT wired into pre-commit on staged files.nuxt typecheckrequires the full Nuxt context and takes minutes locally, which would block every commit; CI already gates it (typecheckjob), and pre-commit now blocks on ESLint + markdownlint.## Done whenonly requires "CI runs lint and typecheck green", which this satisfies.Scope expansion, declared: issue
## Filesdeclaredpackage.json,.husky/**; this PR also touches.github/workflows/ci.yml, neweslint.config.mjs, and mechanical lint-compliance fixes acrossapp/features/**+app/app.vue(vue/max-attributes-per-line auto-fixes,defineOptions({ name: "OsTaskbar" }), one deadprefixremoved fromapp/features/shared/vfs.ts, one unusederrordestructure removed from ChatWindow.vue). No logic changes;npm run buildandnpm run typecheckexit 0.Known follow-up (not blocking): 13
@typescript-eslint/no-explicit-anywarnings remain at the runtime/ai boundary, downgraded towarnwith intent to tighten in the runtime-engine lane.Closes #82.