Skip to content

Conversation

pawcoding
Copy link
Owner

@pawcoding pawcoding commented Oct 12, 2025

Warning

Not ready to merge yet. oxc VsCode extension does not yet handle ignoring linter warnings.

Changes

Summary:
This PR enables type-aware linting rules with oxlint using tsgolint. In addition there were a few adjustments needed to comply with our strict ruleset. This mainly boiled down to create zod schemas for every PocketBase API response, which automatically parses and validates the responses to be typesafe in addition to providing types for these responses.

Issues

Testing

  • Manual testing completed
  • Automated tests added/updated

Code Quality

  • Code follows existing patterns and conventions
  • Functions are small and focused
  • Types are properly defined
  • Error handling is appropriate
  • Documentation is updated if needed

Breaking Changes

Are there any breaking changes?

  • No breaking changes
  • Yes, breaking changes (describe below)

Migration notes:
Should not be breaking, every existing test still works as expected. Though I'll test this in my own repository and leave it on next for other developers to beta-test these changes.

@pawcoding pawcoding requested a review from Copilot October 12, 2025 10:17
@pawcoding pawcoding self-assigned this Oct 12, 2025
Copy link

@Copilot 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 enables type-aware linting with oxlint using TypeScript-ESLint rules. The primary focus is on creating Zod schemas for PocketBase API responses to ensure type safety and automatic validation, while also making necessary adjustments to comply with the stricter linting rules.

  • Replaced interfaces with Zod schemas for all PocketBase types to enable validation
  • Added type-aware linting configuration with oxlint and disabled specific rules for test files
  • Removed generic type parameters from functions to simplify the type system

Reviewed Changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/types/pocketbase-schema.type.ts Converted interfaces to Zod schemas with strict field type validation
src/types/pocketbase-entry.type.ts Replaced interface with Zod schema using passthrough for additional fields
src/types/pocketbase-api-response.type.ts Added new Zod schemas for PocketBase API responses (error, list, login)
src/utils/get-superuser-token.ts Added response parsing with Zod schemas
src/schema/get-remote-schema.ts Added response validation using Zod schemas
src/loader/fetch-*.ts Removed generic type parameters and added response validation
src/loader/cleanup-entries.ts Added response validation and improved type safety
package.json Added oxlint-tsgolint dependency and type-aware flags
.oxlintrc.json Added type-aware linting rules and disabled unsafe TypeScript rules for tests

@pawcoding pawcoding force-pushed the build/type-aware-linting branch from f1554cc to 8e06367 Compare October 12, 2025 14:43
Copy link
Owner Author

@pawcoding pawcoding left a comment

Choose a reason for hiding this comment

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

Self-review done ✔️

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.

1 participant