feat(apollo-vertex): enable type-aware linting and fix all violations#400
Merged
feat(apollo-vertex): enable type-aware linting and fix all violations#400
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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
oxlintinapps/apollo-vertexand adjust lint rules to reduce false positives. - Extract
ThemeConfiginto 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). |
b0ed307 to
1af1ae9
Compare
Dependency License Review
License distribution
Excluded packages
|
1af1ae9 to
0e5fd0c
Compare
3bd55f3 to
9633ca8
Compare
9633ca8 to
fe588af
Compare
fe588af to
87ee7e2
Compare
87ee7e2 to
0ca20fa
Compare
0xr3ngar
approved these changes
Mar 27, 2026
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
0ca20fa to
a3c5473
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--type-aware) for apollo-vertexcss-imports.d.tsto resolve TS2882 on side-effect CSS importsJSON.parsecasts with Zod schema validation where possible (stream parser, theme config)instanceofchecks in input-group, runtime validation for custom events in shell-locale-providerThemeConfigtype in shell-theme-provider so it works standalone from registryWhat couldn't be fixed without casts
as React.CSSPropertiesfor CSS custom properties in registry components (must be self-contained forshadcn add)Object.keys/Object.entrieslosingkeyof(TypeScript by design)row.getValue()/ColumnDef.accessorKeyreturningunknownobject→Record<string, unknown>indexing (microsoft/TypeScript#38801)