Skip to content

fix(template): lint-ignore generated types in shared/appkit-types - #733

Merged
atilafassina merged 2 commits into
mainfrom
work/15-lint-ignore-generated-types-in
Nov 13, 2026
Merged

atilafassina merged 2 commits into
mainfrom
work/15-lint-ignore-generated-types-in

Conversation

@atilafassina

@atilafassina atilafassina commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes LA-2385 (follow-up to #665).

Problem

appkit generate-types and the Vite plugin write shared/appkit-types/*.d.ts. With no database schema or metric views, database.d.ts and metric-views.d.ts contain empty registry interfaces (interface DatabaseRegistry {}, interface MetricRegistry {}), and the template's .oxlintrc.json reports them as typescript(no-empty-object-type). In NFL-Scout evals, 8 of 20 sampled trajectories hit this error and 5 edited .oxlintrc.json to get around it.

Fix: ignore the directory (not a typegen change)

  • template/.oxlintrc.json now lists shared/appkit-types/** in ignorePatterns.
  • I didn't change typegen to stop emitting empty interfaces. Those empty interfaces are how the generated types attach to the interfaces AppKit declares: interface DatabaseRegistry extends GeneratedDatabaseRegistry {} works through declaration merging, and a type alias can't merge. The interface is empty whenever nothing has been generated yet, so typegen can't avoid it. Generated files are also overwritten on every run, so any lint error in them (no-explicit-any, no-unsafe-* and so on) can't be fixed where it's reported. Ignoring the whole directory covers every generated file, now and later.

Also: server/example.test.ts

A fresh scaffold also failed its own lint script with 3× typescript(require-await) in server/example.test.ts. That has been there since the testing kit landed (#530/#540). I removed async where nothing is awaited: setup() and the route handler now return Promise.resolve(), and greet is a sync generator (expectStream accepts any Iterable).

Test

tools/template-smoke-runner.ts (CI smoke-test-template --run, pnpm and npm): after the build, which runs typegen, the runner writes the empty-registry declarations the generator emits (taken from the repo's own NEUTRAL_DATABASE_TYPES / generateMetricTypeDeclarations([]), and only if the build didn't write them) and then runs the app's own lint script.

Verification

  • Fresh scaffold + generate-types, old config: 2× no-empty-object-type in shared/appkit-types plus 3× require-await. New config: oxlint exits 0.
  • Smoke test --run passes for pnpm and npm. With the old .oxlintrc.json it fails on the no-empty-object-type errors.
  • pnpm build, pnpm typecheck, pnpm check:fix, pnpm docs:build and the vitest tools project (102 tests) pass. The scaffold's typecheck and example.test.ts (3 tests) pass.

This pull request and its description were written by Isaac.

atilafassina and others added 2 commits November 12, 2026 22:42
`appkit generate-types` and the Vite plugin write `shared/appkit-types/*.d.ts`.
With no database schema or metric views, `database.d.ts` and
`metric-views.d.ts` carry empty registry interfaces, which trip
`typescript/no-empty-object-type` on a fresh scaffold. Generated files are
overwritten on the next run, so ignore the directory rather than lint it.

Also drop `async` from the three functions in `server/example.test.ts` that
never await (`typescript/require-await`), so a fresh scaffold passes its own
`lint` script.

Refs LA-2385

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Atila Fassina <atila@fassina.eu>
After the build, write the empty-registry declarations typegen emits for an
app with no database schema or metric views, then run the app's own `lint`
script. Fails on the current main config with no-empty-object-type in
shared/appkit-types.

Refs LA-2385

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Atila Fassina <atila@fassina.eu>
@atilafassina
atilafassina requested a review from a team as a code owner November 12, 2026 21:44
@atilafassina
atilafassina requested review from MarioCadenas and calvarjorge and a balanced review from Copilot November 12, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 AppKit PR bot

🔬 Run evals

Start an eval for this PR from the evals-monitor app: Go to Evals Monitor →

📦 Try this PR's app template

Scaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh auth login — and the Databricks CLI):

gh run download 43313215734 -R databricks/appkit -n appkit-template-0.94.1-pr.9e5ea7e-work-15-lint-ignore-generated-types-in-733 -D appkit-pr-733 \
  && unzip -o "appkit-pr-733/appkit-template-0.94.1-pr.9e5ea7e-work-15-lint-ignore-generated-types-in-733.zip" -d "appkit-pr-733" \
  && databricks apps init --template "appkit-pr-733"

The template pins @databricks/appkit and @databricks/appkit-ui to tarballs built from this branch, so the scaffolded app runs against this PR's code.

@atilafassina

Copy link
Copy Markdown
Contributor Author

Review 3 · Pass

Does the change do what the task asked? Yes. Gate: major and worse must be fixed.

The changed template ignores generated AppKit types, and an isolated scaffold now passes lint, build, typecheck, and tests. The old config reproduces both reported generated-type lint errors; the reviewed PR is open, ready for review, and approved at this commit.

No findings.

@calvarjorge calvarjorge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. I ran the template smoke test at dc02ea8 and it passes. In the scaffold, the old config gives 2× no-empty-object-type and the old example.test.ts gives 3× require-await; with this PR, oxlint is clean. Ignoring the generated directory is the right fix, since the empty registry interfaces are needed for declaration merging and tsc still checks those files.

@atilafassina
atilafassina merged commit f448f6c into main Nov 13, 2026
13 of 15 checks passed
@atilafassina
atilafassina deleted the work/15-lint-ignore-generated-types-in branch November 13, 2026 10:30
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.

4 participants