Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(linter) bug in fixer for prefer-jest-mocked #5228

Closed
camc314 opened this issue Aug 26, 2024 · 0 comments · Fixed by #5243
Closed

bug(linter) bug in fixer for prefer-jest-mocked #5228

camc314 opened this issue Aug 26, 2024 · 0 comments · Fixed by #5243
Labels
C-bug Category - Bug

Comments

@camc314
Copy link
Collaborator

camc314 commented Aug 26, 2024

input:

(foo as jest.Mock) = jest.fn();

fixed:

(jest.mocked(foo)) = jest.fn();
  × Cannot assign to this expression
    ╭─[<path>]
  9 │ 
 10 │ (jest.mocked(foo)) = jest.fn();
    ·  ────────────────
    ╰────

Finished in 3ms on 1 file with 312 rules using 12 threads.
Found 0 warnings and 1 error.
@camc314 camc314 added the C-bug Category - Bug label Aug 26, 2024
DonIsaac pushed a commit that referenced this issue Aug 27, 2024
…expressions (#5243)

closes #5228

interestingly `eslint-plugin-jest` reports an error on this code, it also immedietly fixes it.
however fixing here is not good as it results in invalid code.

should fix https://github.com/oxc-project/oxlint-ecosystem-ci/actions/runs/10518058484/job/29247525457
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants