eslint-plugin-jest 28.8.2 → 28.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,7 +90,7 @@ var _default = exports.default = (0, _utils2.createRule)({
90
90
  }
91
91
  const requireNode = sourceCode.ast.body.find(node => node.type === _utils.AST_NODE_TYPES.VariableDeclaration && node.declarations.some(declaration => declaration.init?.type === _utils.AST_NODE_TYPES.CallExpression && (0, _utils2.isIdentifier)(declaration.init.callee, 'require') && (0, _utils2.isStringNode)(declaration.init.arguments[0], '@jest/globals') && (declaration.id.type === _utils.AST_NODE_TYPES.Identifier || declaration.id.type === _utils.AST_NODE_TYPES.ObjectPattern)));
92
92
  if (requireNode?.type !== _utils.AST_NODE_TYPES.VariableDeclaration) {
93
- return fixer.insertTextBefore(reportingNode, `${createFixerImports(isModule, functionsToImport)}\n`);
93
+ return fixer.insertTextBefore(firstNode, `${createFixerImports(isModule, functionsToImport)}\n`);
94
94
  }
95
95
  if (requireNode.declarations[0]?.id.type === _utils.AST_NODE_TYPES.ObjectPattern) {
96
96
  for (const property of requireNode.declarations[0].id.properties) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-jest",
3
- "version": "28.8.2",
3
+ "version": "28.8.3",
4
4
  "description": "ESLint rules for Jest",
5
5
  "keywords": [
6
6
  "eslint",