eslint-plugin-jest 28.13.2 → 28.13.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.
@@ -99,9 +99,17 @@ var _default = exports.default = (0, _utils2.createRule)({
99
99
  }
100
100
  if (requireNode.declarations[0]?.id.type === _utils.AST_NODE_TYPES.ObjectPattern) {
101
101
  for (const property of requireNode.declarations[0].id.properties) {
102
- if (property.type === _utils.AST_NODE_TYPES.Property && (0, _utils2.isSupportedAccessor)(property.key)) {
103
- functionsToImport.add((0, _utils2.getAccessorValue)(property.key));
102
+ if (property.type !== _utils.AST_NODE_TYPES.Property || !(0, _utils2.isSupportedAccessor)(property.key)) {
103
+ continue;
104
104
  }
105
+ let importName = (0, _utils2.getAccessorValue)(property.key);
106
+ if ((0, _utils2.isSupportedAccessor)(property.value)) {
107
+ const local = (0, _utils2.getAccessorValue)(property.value);
108
+ if (importName !== local) {
109
+ importName += `: ${local}`;
110
+ }
111
+ }
112
+ functionsToImport.add(importName);
105
113
  }
106
114
  }
107
115
  return fixer.replaceText(requireNode, `${createFixerImports(isModule, functionsToImport)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-jest",
3
- "version": "28.13.2",
3
+ "version": "28.13.3",
4
4
  "description": "ESLint rules for Jest",
5
5
  "keywords": [
6
6
  "eslint",