@arthurgeron/eslint-plugin-react-usememo
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -105,3 +105,3 @@ 'use strict'; | ||
function getIdentifierMemoStatus(context, _a) { | ||
var _b, _c; | ||
var _b, _c, _d, _e; | ||
var name = _a.name; | ||
@@ -117,7 +117,8 @@ var variableInScope = context.getScope().variables.find(function (v) { return v.name === name; }); | ||
} | ||
var isFunctionParameter = node.id.name !== name; | ||
if (node.type === "FunctionDeclaration") | ||
return { node: node, status: MemoStatus.UnmemoizedFunction }; | ||
return { node: node, status: isFunctionParameter ? MemoStatus.Memoized : MemoStatus.UnmemoizedFunction }; | ||
if (node.type !== "VariableDeclarator") | ||
return { node: node, status: MemoStatus.Memoized }; | ||
if (((_c = node === null || node === void 0 ? void 0 : node.parent) === null || _c === void 0 ? void 0 : _c.kind) === "let") { | ||
if (((_c = node === null || node === void 0 ? void 0 : node.parent) === null || _c === void 0 ? void 0 : _c.kind) === "let" && ((_d = node === null || node === void 0 ? void 0 : node.init) === null || _d === void 0 ? void 0 : _d.type) === 'CallExpression' && getIsHook((_e = node === null || node === void 0 ? void 0 : node.init) === null || _e === void 0 ? void 0 : _e.callee)) { | ||
return { node: node.parent, status: MemoStatus.UnsafeLet }; | ||
@@ -128,3 +129,4 @@ } | ||
function getExpressionMemoStatus(context, expression) { | ||
switch (expression.type) { | ||
switch (expression === null || expression === void 0 ? void 0 : expression.type) { | ||
case undefined: | ||
case "ObjectExpression": | ||
@@ -131,0 +133,0 @@ return { node: expression, status: MemoStatus.UnmemoizedObject }; |
{ | ||
"name": "@arthurgeron/eslint-plugin-react-usememo", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
37843
497