eslint-plugin-jest
Advanced tools
Comparing version 28.1.1 to 28.2.0
@@ -312,5 +312,6 @@ "use strict"; | ||
if (maybeImport) { | ||
// the identifier is imported from @jest/globals, | ||
// so return the original import name | ||
if (maybeImport.source === '@jest/globals') { | ||
const globalPackage = context.settings.jest?.globalPackage ?? '@jest/globals'; | ||
// the identifier is imported from our global package so return the original import name | ||
if (maybeImport.source === globalPackage) { | ||
return { | ||
@@ -317,0 +318,0 @@ original: maybeImport.imported, |
{ | ||
"name": "eslint-plugin-jest", | ||
"version": "28.1.1", | ||
"version": "28.2.0", | ||
"description": "ESLint rules for Jest", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -90,2 +90,23 @@ <div align="center"> | ||
#### Aliased `@jest/globals` | ||
You can tell this plugin to treat a different package as the source of Jest | ||
globals using the `globalPackage` setting: | ||
```json | ||
{ | ||
"settings": { | ||
"jest": { | ||
"globalPackage": "bun:test" | ||
} | ||
} | ||
} | ||
``` | ||
> [!WARNING] | ||
> | ||
> While this can be used to apply rules when using alternative testing libraries | ||
> and frameworks like `bun`, `vitest` and `node`, there's no guarantee the | ||
> semantics this plugin assumes will hold outside of Jest | ||
### Running rules only on test-related files | ||
@@ -92,0 +113,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
314163
420