eslint-plugin-reanimated
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -37,2 +37,3 @@ "use strict"; | ||
"Number", | ||
"CallableFunction", | ||
]; | ||
@@ -42,2 +43,15 @@ const functionNames = Array.from(functionHooks.keys()); | ||
const JSFunctionInWorkletMessage = "{{name}} is not a worklet. Use runOnJS instead."; | ||
const isVarInScope = (name, scope) => { | ||
const { variables } = scope; | ||
if (variables.find((v) => v.name === name) !== undefined) { | ||
return true; | ||
} | ||
else if (scope.type === "function") { | ||
return false; | ||
} | ||
else if (scope.upper === null) { | ||
return false; | ||
} | ||
return isVarInScope(name, scope.upper); | ||
}; | ||
exports.default = createRule({ | ||
@@ -132,4 +146,4 @@ name: "js-function-in-worklet", | ||
const declaration = signature === null || signature === void 0 ? void 0 : signature.declaration; | ||
const { variables } = context.getScope(); | ||
if (variables.find((v) => v.name === name) !== undefined) { | ||
const inScope = isVarInScope(name, context.getScope()); | ||
if (inScope) { | ||
return; | ||
@@ -136,0 +150,0 @@ } |
{ | ||
"name": "eslint-plugin-reanimated", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,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
10738
201