eslint-plugin-react-refresh
Advanced tools
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 |
{ | ||
"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", |
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
11493
185