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

eslint-plugin-react-refresh

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-refresh - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

17

index.js

@@ -93,3 +93,2 @@ "use strict";

const handleExportDeclaration = (node) => {
var _a;
if (node.type === "VariableDeclaration") {

@@ -99,3 +98,3 @@ for (const variable of node.declarations) {

variable.id,
((_a = variable.init) == null ? void 0 : _a.type) === "ArrowFunctionExpression",
canBeReactFunctionComponent(variable.init),
variable.init

@@ -116,2 +115,4 @@ );

if (node.type === "ExportAllDeclaration") {
if (node.exportKind === "type")
continue;
hasExports = true;

@@ -170,2 +171,14 @@ context.report({ messageId: "exportAll", node });

};
var canBeReactFunctionComponent = (init) => {
if (!init)
return false;
if (init.type === "ArrowFunctionExpression")
return true;
if (init.type === "CallExpression") {
if (init.callee.type === "Identifier") {
return ["memo", "forwardRef"].includes(init.callee.name);
}
}
return false;
};

@@ -172,0 +185,0 @@ // src/index.ts

2

package.json
{
"name": "eslint-plugin-react-refresh",
"description": "Validate that your components can safely be updated with fast refresh",
"version": "0.4.0",
"version": "0.4.1",
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",

@@ -6,0 +6,0 @@ "license": "MIT",

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