🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

eslint-plugin-react-hooks-extra

Package Overview
Dependencies
Maintainers
1
Versions
1267
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-hooks-extra - npm Package Compare versions

Comparing version

to
1.48.3-next.0

13

dist/index.js

@@ -55,3 +55,3 @@ 'use strict';

var name2 = "eslint-plugin-react-hooks-extra";
var version = "1.48.2";
var version = "1.48.3-next.0";
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("hooks-extra"));

@@ -163,2 +163,3 @@ function isFromHookCall(context, name3, settings, predicate = eff.constTrue) {

const additionalHooks = settings.additionalHooks;
const getText = (n) => context.sourceCode.getText(n);
const isUseEffectLikeCall = ER7__namespace.isReactHookCallWithNameAlias(context, useEffectKind, additionalHooks[useEffectKind]);

@@ -189,2 +190,8 @@ const isUseStateCall = ER7__namespace.isReactHookCallWithNameAlias(context, "useState", additionalHooks.useState);

}
function getCallName(node) {
if (node.type === types.AST_NODE_TYPES.CallExpression) {
return AST__namespace.toString(node.callee, getText);
}
return AST__namespace.toString(node, getText);
}
function getCallKind(node) {

@@ -305,3 +312,3 @@ return tsPattern.match(node).when(isUseStateCall, () => "useState").when(isUseEffectLikeCall, () => useEffectKind).when(isSetStateCall, () => "setState").when(isThenCall, () => "then").otherwise(() => "other");

onViolation(context, setStateCall, {
name: AST__namespace.toString(setStateCall, (n) => context.sourceCode.getText(n))
name: getCallName(setStateCall)
});

@@ -314,3 +321,3 @@ }

onViolation(context, setStateCall, {
name: AST__namespace.toString(setStateCall, (n) => context.sourceCode.getText(n))
name: getCallName(setStateCall)
});

@@ -317,0 +324,0 @@ }

{
"name": "eslint-plugin-react-hooks-extra",
"version": "1.48.2",
"version": "1.48.3-next.0",
"description": "ESLint React's ESLint plugin for React Hooks related rules.",

@@ -53,8 +53,8 @@ "keywords": [

"ts-pattern": "^5.7.0",
"@eslint-react/ast": "1.48.2",
"@eslint-react/core": "1.48.2",
"@eslint-react/eff": "1.48.2",
"@eslint-react/shared": "1.48.2",
"@eslint-react/kit": "1.48.2",
"@eslint-react/var": "1.48.2"
"@eslint-react/ast": "1.48.3-next.0",
"@eslint-react/core": "1.48.3-next.0",
"@eslint-react/kit": "1.48.3-next.0",
"@eslint-react/shared": "1.48.3-next.0",
"@eslint-react/var": "1.48.3-next.0",
"@eslint-react/eff": "1.48.3-next.0"
},

@@ -61,0 +61,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet