Skip to content

feat(apollo-vertex): enable type-aware linting and fix all violations#400

Merged
KokoMilev merged 6 commits intomainfrom
feat/apollo-vertex-type-aware-linting
Mar 27, 2026
Merged

feat(apollo-vertex): enable type-aware linting and fix all violations#400
KokoMilev merged 6 commits intomainfrom
feat/apollo-vertex-type-aware-linting

Conversation

@KokoMilev
Copy link
Copy Markdown
Contributor

@KokoMilev KokoMilev commented Mar 25, 2026

Summary

  • Enable oxlint type-aware rules (--type-aware) for apollo-vertex
  • Add css-imports.d.ts to resolve TS2882 on side-effect CSS imports
  • Fix all type-aware lint violations across ~35 files
  • Replace JSON.parse casts with Zod schema validation where possible (stream parser, theme config)
  • Fix unsafe patterns: null context defaults in form, instanceof checks in input-group, runtime validation for custom events in shell-locale-provider
  • Inline ThemeConfig type in shell-theme-provider so it works standalone from registry
  • Fix pre-existing format issues in apollo-react icon components

What couldn't be fixed without casts

  • as React.CSSProperties for CSS custom properties in registry components (must be self-contained for shadcn add)
  • Object.keys/Object.entries losing keyof (TypeScript by design)
  • Recharts untyped payloads
  • TanStack row.getValue() / ColumnDef.accessorKey returning unknown
  • objectRecord<string, unknown> indexing (microsoft/TypeScript#38801)

Copilot AI review requested due to automatic review settings March 25, 2026 16:25
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

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

Project Deployment Review Updated (PT)
apollo-canvas 🟢 Ready Preview, Logs Mar 27, 2026, 08:30:58 AM
apollo-landing 🟢 Ready Preview, Logs Mar 27, 2026, 08:28:00 AM
apollo-ui-react 🟢 Ready Preview, Logs Mar 27, 2026, 08:29:56 AM
apollo-vertex 🟢 Ready Preview, Logs Mar 27, 2026, 08:29:11 AM
apollo-wind 🟢 Ready Preview, Logs Mar 27, 2026, 08:28:56 AM

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR is a WIP cleanup pass for the apollo-vertex app focused on tightening runtime validation (via Zod schemas), improving type-safety/lint compliance (type-aware oxlint + targeted suppressions), and refactoring a number of UI templates/components to prefer nullish coalescing and safer parsing patterns.

Changes:

  • Enable type-aware oxlint in apps/apollo-vertex and adjust lint rules to reduce false positives.
  • Extract ThemeConfig into a shared Zod schema and use it to validate persisted/imported theme data and selected theme names.
  • Apply targeted type/lint fixes across templates and registry components (nullish coalescing, guarded casts, and async handling patterns).

Reviewed changes

Copilot reviewed 36 out of 37 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
apps/apollo-vertex/tsconfig.json Removes baseUrl while retaining path aliases.
apps/apollo-vertex/templates/DataTableTemplate.tsx Adds lint suppressions/casts and clipboard handler changes.
apps/apollo-vertex/templates/AiChatTemplate.tsx Adds lint suppression for async onSendMessage.
apps/apollo-vertex/registry/use-data-table/useEntityColumns.tsx Simplifies ColumnDef typing.
apps/apollo-vertex/registry/use-data-table/useDataTable.tsx Adjusts column typing and accessor key extraction.
apps/apollo-vertex/registry/use-data-table/useColumnVisibility.ts Adds lint suppression for intentional boolean comparison.
apps/apollo-vertex/registry/use-data-table/types.ts Updates ColumnDefWithAccessorKey typing.
apps/apollo-vertex/registry/toggle-group/toggle-group.tsx Uses ?? instead of `
apps/apollo-vertex/registry/sonner/sonner.tsx Narrows/casts theme + adds CSSProperties cast suppression.
apps/apollo-vertex/registry/sidebar/sidebar.tsx Adds CSSProperties cast suppression for custom props.
apps/apollo-vertex/registry/sidebar/sidebar-menu-skeleton.tsx Adds CSSProperties cast suppression for custom props.
apps/apollo-vertex/registry/shell/shell-theme-provider.tsx Moves ThemeConfig type to shared schema module and re-exports it.
apps/apollo-vertex/registry/shell/shell-login.tsx Tweaks conditional rendering logic and voids async call.
apps/apollo-vertex/registry/shell/shell-locale-provider.tsx Adds cast suppression and voids async configure() call.
apps/apollo-vertex/registry/shell/shell-auth-provider.tsx Switches to z.email() and simplifies query function.
apps/apollo-vertex/registry/progress/progress.tsx Uses ?? to preserve 0 values.
apps/apollo-vertex/registry/input-group/input-group.tsx Adds comment/suppression around e.target casting.
apps/apollo-vertex/registry/form/form.tsx Adds context default-value suppression and adjusts aria-describedby.
apps/apollo-vertex/registry/data-table/data-table.tsx Adds lint suppression for String(value) conversion.
apps/apollo-vertex/registry/data-table/data-table-faceted-filter.tsx Adds lint suppression for unknown filter value handling.
apps/apollo-vertex/registry/chart/chart.tsx Multiple nullish-coalescing and typing/suppression adjustments.
apps/apollo-vertex/registry/ai-chat/utils/providers/openai/openai-stream.ts Adds JSON parse assertions + TODOs for validation.
apps/apollo-vertex/registry/ai-chat/utils/ai-chat-api.ts Adds type assertion for resolving lazy config values.
apps/apollo-vertex/registry/ai-chat/hooks/use-ai-chat.ts Adds JSON parse assertion + TODO for validation.
apps/apollo-vertex/registry/ai-chat/components/ai-chat-tool-group.tsx Uses ?? for collapse state defaulting.
apps/apollo-vertex/registry/ai-chat/components/ai-chat-markdown.tsx Simplifies className fallback with ??.
apps/apollo-vertex/registry/ai-chat/components/ai-chat-input.tsx Uses SubmitEvent typing for form submit handler.
apps/apollo-vertex/package.json Enables type-aware oxlint and adds oxlint-tsgolint.
apps/apollo-vertex/lib/schemas/theme.ts Adds ThemeConfigSchema + inferred ThemeConfig type.
apps/apollo-vertex/lib/i18n.ts Adds type assertions/guards around supported locales and callback error typing.
apps/apollo-vertex/lib/auth.ts Adds token response schema validation + improves error message extraction.
apps/apollo-vertex/app/themes/customize/theme-customizer.tsx Validates imported/saved themes via ThemeConfigSchema.
apps/apollo-vertex/app/themes.ts Adds ThemeNameSchema and validates stored custom themes.
apps/apollo-vertex/app/patterns/notifications/in-product/notification-examples.tsx Replaces unsafe cast with instanceof guard.
apps/apollo-vertex/app/components/theme-switcher.tsx Validates theme name from storage and selection via Zod.
apps/apollo-vertex/.oxlintrc.json Adjusts lint rules (allow void statements, disable some TS rules, allow TODOs).

@KokoMilev KokoMilev force-pushed the feat/apollo-vertex-type-aware-linting branch from b0ed307 to 1af1ae9 Compare March 27, 2026 10:34
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

Dependency License Review

  • 1924 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 3 package(s) excluded (see details below)
License distribution
License Packages
MIT 1689
ISC 89
Apache-2.0 56
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 5
MIT OR Apache-2.0 3
MIT-0 3
CC0-1.0 3
LGPL-3.0-or-later 2
(MIT OR Apache-2.0) 2
Unlicense 2
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
@img/sharp-libvips-linuxmusl-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI review requested due to automatic review settings March 27, 2026 12:21
@KokoMilev KokoMilev force-pushed the feat/apollo-vertex-type-aware-linting branch from 1af1ae9 to 0e5fd0c Compare March 27, 2026 12:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 35 out of 39 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@KokoMilev KokoMilev force-pushed the feat/apollo-vertex-type-aware-linting branch 2 times, most recently from 3bd55f3 to 9633ca8 Compare March 27, 2026 12:52
Copilot AI review requested due to automatic review settings March 27, 2026 12:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 35 out of 39 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@KokoMilev KokoMilev force-pushed the feat/apollo-vertex-type-aware-linting branch from 9633ca8 to fe588af Compare March 27, 2026 13:00
Copilot AI review requested due to automatic review settings March 27, 2026 13:29
@KokoMilev KokoMilev force-pushed the feat/apollo-vertex-type-aware-linting branch from fe588af to 87ee7e2 Compare March 27, 2026 13:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 35 out of 38 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@KokoMilev KokoMilev changed the title feat(apollo-vertex): wip feat(apollo-vertex): enable type-aware linting and fix all violations Mar 27, 2026
@KokoMilev KokoMilev force-pushed the feat/apollo-vertex-type-aware-linting branch from 87ee7e2 to 0ca20fa Compare March 27, 2026 13:51
@KokoMilev KokoMilev marked this pull request as ready for review March 27, 2026 14:38
@KokoMilev KokoMilev requested a review from a team as a code owner March 27, 2026 14:38
@KokoMilev KokoMilev requested review from 0xr3ngar, alincadariu and Copilot and removed request for a team March 27, 2026 14:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 40 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Add pnpm.overrides to pin vulnerable transitive dependencies:
picomatch >=4.0.4, yaml >=2.8.3, brace-expansion >=5.0.5,
flatted >=3.4.2, happy-dom >=20.8.8, handlebars >=4.7.9.

Also add zod to apollo-vertex for runtime JSON validation.
… casts

Add css-imports.d.ts for side-effect CSS imports. Restore
as React.CSSProperties casts in registry components so they
work standalone when installed via shadcn add.
- Add Zod schema for theme config validation (JSON.parse safety)
- Fix form context to use null instead of empty-object casts
- Use instanceof check instead of cast in input-group
- Add runtime validation for custom events in shell-locale-provider
- Suppress unavoidable casts at library boundaries (tanstack, recharts)
- Replace JSON.parse cast with Zod schema validation in stream parser
- Fix SubmitEvent (nonexistent) to FormEvent in ai-chat-input
- Suppress unavoidable casts at library boundaries
@KokoMilev KokoMilev force-pushed the feat/apollo-vertex-type-aware-linting branch from 0ca20fa to a3c5473 Compare March 27, 2026 15:26
@KokoMilev KokoMilev merged commit d9a05ef into main Mar 27, 2026
44 checks passed
@KokoMilev KokoMilev deleted the feat/apollo-vertex-type-aware-linting branch March 27, 2026 15:44
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.

3 participants