Skip to content

Migrate lint and fmt to @liangmi/vp-config - #23

Draft
0froq wants to merge 1 commit into
mainfrom
cursor/vp-config-liangmi-575d
Draft

0froq wants to merge 1 commit into
mainfrom
cursor/vp-config-liangmi-575d

Conversation

@0froq

@0froq 0froq commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Replace hand-written .oxlintrc.json / .oxfmtrc.json plus vp lint --config with @liangmi/vp-config (liangmi()). Lint is flat-config via oxlint-flat-config; fmt comes from the preset plus lig-specific options.

What moved where

Vite+ discovers lint / fmt from a root vite.config.ts (not from tooling/ and not from JSON files). liangmi() also locates the project from that file’s directory, so a config under tooling/ would be treated as a workspace member and would not emit lint/fmt.

Root vite.config.ts is now the Vite+ tool config (liangmi() for Oxlint, Oxfmt, and Vitest). Nuxt still owns application Vite via nuxt.config.ts and ignores this file (B5004 is expected if it appears). The old tooling/vite.config.ts Vitest settings (tsconfig: 'core/tsconfig.json', node environment, token/syntax/port includes) moved into the same root file so vp test no longer needs --config.

pack is excluded (this is not a library). The preset staged task (vp check --fix) is excluded: this site’s check is lint + fmt + nuxt typecheck, not built-in vp check. lint-staged stays on simple-git-hooks.

Dependencies

  • @liangmi/vp-config@1.0.0 in the dev catalog
  • oxlint-flat-config@0.4.0 and @oxlint-flat-config/composer@0.3.1 pulled transitively
  • Added to trustPolicyExclude (first publishes; no-downgrade otherwise blocks install)
  • Node engines and pnpm version unchanged (^24.21.0, pnpm 12.11.2)

Scripts / hooks

Script Before After
lint / lint:fix vp lint --config .oxlintrc.json . vp lint / vp lint --fix
fmt / fmt:check vp fmt --config .oxfmtrc.json . vp fmt / vp fmt --check
check lint + fmt:check + nuxt typecheck unchanged entrypoints
test / tokens:test / syntax:test / ports:test vp test --config tooling/vite.config.ts vp test
lint-staged explicit JSON --config vp lint --fix + vp fmt (loads vite.config.ts)

Cached ccheck is not wired: it runs vp check (Oxlint typecheck), which does not replace nuxt typecheck on this site.

Vue / React

Vue is on (vue in dependencies, plus .option({ vue: true, browser: true, node: true })). React is not enabled (react: false; no React rules in the resolved config).

Ignores (preserved)

Lint: vendor/**, content/**, **/generated/**, .agents/** (plus preset bin/**).

Fmt: those plus public/**, **/fixtures/**, docs/plans/**, AGENTS.md, pnpm-lock.yaml, skills-lock.json.

Also kept lig fmt options: single quotes already from the preset, plus quoteProps: 'consistent', singleAttributePerLine, htmlWhitespaceSensitivity: 'strict', trailingComma: 'all'. Import / package.json sorting from the preset is off so this PR does not reformat the tree.

Overrides (infrastructure only)

The preset is stricter than the old correctness-only Oxlint JSON. Rather than rewriting app code:

  • Oxlint typeAware / typeCheck off so the tokens workflow can lint without .nuxt
  • .remove('liangmi/style') (hundreds of curly / comment style hits)
  • lig/compat turns off restriction/nursery rules that fire across the existing tree (import/extensions, node/no-sync, unicorn/no-array-sort, …)
  • no-console allowed only under **/scripts/**

Verification

pnpm install
pnpm check          # lint + fmt:check + nuxt typecheck — green
pnpm exec vp run tokens:test   # 21 tests, root Vitest config

Pre-commit lint-staged also ran successfully on this commit with the new vp lint / vp fmt commands.

Remaining gaps

  • Style/restriction rules in lig/compat can be re-enabled in a follow-up that actually formats/fixes source.
  • Oxlint type-aware checking is off; Vue types stay on nuxt typecheck.
  • Historical notes under docs/plans/** still mention .oxfmtrc.json (fmt-ignored on purpose).
  • Other froQ sites, @froq/ui publish, osdash, and skills-pack are out of scope.
Open in Web Open in Cursor 

Replace root Oxlint/Oxfmt JSON configs with liangmi() in vite.config.ts
so vp lint, vp fmt, and Vitest load the same Vite+ config. Nuxt still
owns application Vite via nuxt.config.ts.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 689e85d 2026-10-26T15:34:05.932Z View logs ↗

0froq added a commit to 0froq/0froq.github.io that referenced this pull request Oct 26, 2026
Replace hand-written Oxlint/Oxfmt JSON plus `vp lint --config` with
`liangmi()` in root vite.config.ts, matching 0froq/lig#23.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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