Skip to content

fix(internationalized-array): resolve TypeScript lint errors in test files#544

Merged
pedrobonamin merged 2 commits intofeat/internationalized-array-testsfrom
copilot/sub-pr-542
Feb 4, 2026
Merged

fix(internationalized-array): resolve TypeScript lint errors in test files#544
pedrobonamin merged 2 commits intofeat/internationalized-array-testsfrom
copilot/sub-pr-542

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

The test suite had 15 TypeScript lint errors preventing CI from passing. All errors were in test files and related to type safety issues with mocks and assertions.

Changes

  • Index signature property access - Changed item._key to item['_key'] for properties accessed via index signatures (TS4111)
  • Type guards over assertions - Replaced unsafe type assertions with proper type guards:
    // Before
    const schema = createObjectSchema({type: 'string'}) as ObjectSchemaWithFields
    
    // After
    const schema = createObjectSchema({type: 'string'})
    if (!hasFields(schema)) throw new Error('Expected schema to have fields')
  • Validation result typing - Added ValidationResult union type and type narrowing for test assertions:
    type ValidationResult = true | {message: string; paths: Array<Array<{_key: string}>>}
    
    const result = await runValidation(value)
    if (result !== true) {
      expect(result.paths).toEqual([[{_key: 'en'}]])
    }
  • Mock suppression - Used @ts-expect-error for intentional mock implementations that deviate from production types

All 114 tests pass with 0 lint errors.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Feb 4, 2026

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

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview, Comment Feb 4, 2026 2:16pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: ee35f3a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

- Replace dot notation with bracket notation for index signature properties (_key, _type)
- Add type guards for validation rule extraction
- Use proper type narrowing instead of unsafe type assertions
- Add ValidationResult type for better type safety in tests
- Suppress TypeScript errors for test mock implementations with @ts-expect-error
- Add type guards in test assertions to properly narrow union types

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
Copilot AI changed the title [WIP] Add comprehensive test suite for _key migration fix(internationalized-array): resolve TypeScript lint errors in test files Feb 4, 2026
Copilot AI requested a review from pedrobonamin February 4, 2026 14:16
@pedrobonamin pedrobonamin marked this pull request as ready for review February 4, 2026 14:20
@pedrobonamin pedrobonamin merged commit 21f1579 into feat/internationalized-array-tests Feb 4, 2026
8 checks passed
@pedrobonamin pedrobonamin deleted the copilot/sub-pr-542 branch February 4, 2026 14:21
pedrobonamin added a commit that referenced this pull request Feb 4, 2026
…files (#544)

* Initial plan

* fix(internationalized-array): resolve lint errors in test files

- Replace dot notation with bracket notation for index signature properties (_key, _type)
- Add type guards for validation rule extraction
- Use proper type narrowing instead of unsafe type assertions
- Add ValidationResult type for better type safety in tests
- Suppress TypeScript errors for test mock implementations with @ts-expect-error
- Add type guards in test assertions to properly narrow union types

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
pedrobonamin added a commit that referenced this pull request Feb 5, 2026
…files (#544)

* Initial plan

* fix(internationalized-array): resolve lint errors in test files

- Replace dot notation with bracket notation for index signature properties (_key, _type)
- Add type guards for validation rule extraction
- Use proper type narrowing instead of unsafe type assertions
- Add ValidationResult type for better type safety in tests
- Suppress TypeScript errors for test mock implementations with @ts-expect-error
- Add type guards in test assertions to properly narrow union types

Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pedrobonamin <46196328+pedrobonamin@users.noreply.github.com>
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.

2 participants