Skip to content

ci: run ESLint in CI to enforce the @objectstack/spec import guard#2029

Merged
os-zhuang merged 1 commit into
mainfrom
chore/eslint-in-ci
Jun 18, 2026
Merged

ci: run ESLint in CI to enforce the @objectstack/spec import guard#2029
os-zhuang merged 1 commit into
mainfrom
chore/eslint-in-ci

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Actually run ESLint in CI so the existing import guard takes effect.

Why

The repo already had an ESLint flat config whose only rule — no-restricted-imports, banning @objectstack/spec root namespace imports (the documented ~1.2GB RSS regression vector) — but it was completely dormant:

  • eslint wasn't even a devDependency (the config's own comment said "To enable: pnpm add -DW eslint").
  • There was no root lint script.
  • The workflow named lint.yml only ran tsc.

So the guard that should have instantly caught the root-import drift fixed in #2023 had never run. This wires it up.

Changes

  • Add eslint + @typescript-eslint/parser devDeps; wire the parser into the flat config so .ts files parse.
  • Add root lint script: eslint . --no-inline-config. The flag ignores orphaned eslint-disable directives scattered in source (for @typescript-eslint/*, no-console, etc.) left over from a fuller rule set this minimal config no longer registers — without it, eslint . errors on "rule definition not found". The only active rule (the spec import guard) should never need a local opt-out anyway.
  • Add a fast lint job to lint.yml (syntactic only — no build step).

Coverage note

This guard bans the 15 namespace names (Data, UI, System, Identity, Security, …) from the spec root. It does not yet catch concrete-type root imports (Datasource, Theme, Job, …) — those are covered by the example-app typecheck gate added in #2023. Together: typecheck catches concrete-type drift, ESLint catches namespace-name drift with a faster signal. Broadening the rule to an allowImportNames allowlist (catching all type imports) is a sensible follow-up but needs a complete enumeration of legitimate root exports, so it's deliberately out of scope here.

Two pre-existing items surfaced (not addressed here, to keep this focused):

  • Orphaned eslint-disable directives across ~10 files referencing an unregistered rule set.
  • The minimal config only registers one rule; a future fuller TS-lint setup could re-home those directives.

Verification

pnpm lint   # clean, exit 0

Rule confirmed firing on a deliberate import { UI } from '@objectstack/spec'.

🤖 Generated with Claude Code

The repo had an ESLint flat config whose only rule — no-restricted-imports
banning `@objectstack/spec` root namespace imports (the ~1.2GB RSS
regression vector) — was never enforced: eslint wasn't even a devDep, no
`lint` script existed, and the `lint.yml` workflow only ran tsc. The
config's own comment said "To enable: pnpm add -DW eslint". So the guard
that should have caught the root-import drift fixed in #2023 was dormant.

- Add `eslint` + `@typescript-eslint/parser` devDeps; wire the parser into
  the flat config so .ts files parse.
- Add root `lint` script (`eslint . --no-inline-config`). The flag ignores
  orphaned `eslint-disable` directives left over from a richer rule set
  this minimal config no longer registers; the sole active rule should
  never be opted out locally anyway.
- Add a fast `lint` job to lint.yml (syntactic only, no build needed).

Complements the example-app typecheck gate from #2023: typecheck catches
concrete-type root imports, ESLint catches the namespace-name imports and
gives a faster signal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@os-zhuang os-zhuang added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Jun 18, 2026
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 18, 2026 7:02am

Request Review

@github-actions github-actions Bot added ci/cd dependencies Pull requests that update a dependency file size/s labels Jun 18, 2026
@os-zhuang
os-zhuang merged commit 39603a8 into main Jun 18, 2026
19 checks passed
@os-zhuang
os-zhuang deleted the chore/eslint-in-ci branch June 18, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd dependencies Pull requests that update a dependency file size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant