Skip to content

Conversation

@Fryuni
Copy link
Member

@Fryuni Fryuni commented Jan 20, 2026

Summary

Allow unbound methods on tests. Otherwise this common pattern is flagged:

const mockedThing: ThingInterface = {
  someMethod: jest.fn(),
  otherMethod: jest.fn(),
};

// Test some function or class that takes a `ThingInterface`

// Use of unbound method since the type annotation erased
// the information that it is not an instance.
expect(mockedThing.someMethod).toHaveBeenCalledOnceWith(...);

@Fryuni Fryuni marked this pull request as ready for review January 20, 2026 03:13
Copilot AI review requested due to automatic review settings January 20, 2026 03:13
Copy link

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 pull request relaxes the @typescript-eslint/unbound-method rule for test files to prevent false positives when using mocked interfaces with Jest, and adds a new GitHub Actions workflow for publishing PR preview packages.

Changes:

  • Disables the @typescript-eslint/unbound-method rule for test files (*.test.ts, *.test.tsx) to allow common mocking patterns
  • Adds a new PR preview workflow that builds and publishes preview packages using pkg-pr-new

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/configs/typescript.ts Adds a new configuration block that turns off the unbound-method rule for test files to prevent false warnings with mocked interfaces
.github/workflows/pr-preview.yaml Adds a new workflow that builds and publishes preview packages for pull requests using pkg-pr-new

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 20, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@croct/eslint-plugin@483

commit: 1998167

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