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

Jest is automatically in scope. Do not import "jest" in Config file. #289

Closed
SalahAdDin opened this issue Jan 23, 2023 · 6 comments
Closed

Comments

@SalahAdDin
Copy link

  • eslint-plugin-jest-dom version: 4.0.3
  • node version: v18.12.1
  • npm version: 8.19.2

Relevant code or config

import type { Config } from "jest";

const customJestConfig: Config = {
  preset: "ts-jest",
  // We want to clear mocks and instances between every st
  clearMocks: true,

What you did: Just set up the config file.

What happened:
The linter complains about the importing line.
image

Reproduction repository:

Problem description:
The documentation says we need to import the correct type for the configuration object if we are working with Typescript.

However, when we import it, the linter complains about it.

Suggested solution:
The linter should ignore the configuration file, maybe...

@G-Rath
Copy link
Collaborator

G-Rath commented Jan 23, 2023

Duplicate of jest-community/eslint-plugin-jest#1333

@G-Rath G-Rath closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
@SalahAdDin
Copy link
Author

@G-Rath so, it will be automatically fixed in a new release version, right?

@G-Rath
Copy link
Collaborator

G-Rath commented Jan 24, 2023

@SalahAdDin this has nothing to do with this plugin, so no

@SalahAdDin
Copy link
Author

@SalahAdDin this has nothing to do with this plugin, so no

It is related to the main package, wich also deprecated the rule; so, if this package updates the package, the big will be gone.

@G-Rath
Copy link
Collaborator

G-Rath commented Jan 24, 2023

This package does not expose that rule as its own, so there is no bug - there's actually not a bug in the base rule to begin with becuase it's not meant to be run on jest config (which is outlined in the overrides example in our readme)

@SalahAdDin
Copy link
Author

This package does not expose that rule as its own, so there is no bug - there's actually not a bug in the base rule to begin with because it's not meant to be run on jest config (which is outlined in the overrides example in our readme)

No idea, I just moved to vitest. I followed the documentation and enabled the linter, it is being used also in the config file.

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

No branches or pull requests

2 participants