Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arthurgeron/eslint-plugin-react-usememo

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arthurgeron/eslint-plugin-react-usememo - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

10

dist/index.js

@@ -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 };

2

package.json
{
"name": "@arthurgeron/eslint-plugin-react-usememo",
"version": "1.1.2",
"version": "1.1.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc