oxlint-appsync 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -193,7 +193,8 @@ function isFunctionLikeNode(node, context) {
|
|
|
193
193
|
function variableHoldsFunction(name, context, referenceNode) {
|
|
194
194
|
let scope = context.sourceCode.getScope(referenceNode);
|
|
195
195
|
while (scope) {
|
|
196
|
-
|
|
196
|
+
const variable = scope.set.get(name);
|
|
197
|
+
if (variable) return variable.defs.some(definitionCreatesFunction);
|
|
197
198
|
scope = scope.upper;
|
|
198
199
|
}
|
|
199
200
|
return false;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["member","noAppsyncGlobals","noAsyncAwait","noBitwiseNot","noClasses","noContextReassignment","noContinue","noDoWhile","noDisallowedMethods","noForLoop","noFunctionArguments","noFunctionReassign","noFunctionReturn","noGenerators","noInOperator","noInstanceof","noLabeledStatement","noNew","noPromise","noRecursion","noRegex","noGlobalConstructor","noThis","noThrow","noTry","noUpdateOperators","noWhile"],"sources":["../src/lib/appsync-globals.ts","../src/lib/rule-types.ts","../src/rules/no-appsync-globals.ts","../src/lib/utils.ts","../src/rules/no-async-await.ts","../src/rules/no-bitwise-not.ts","../src/rules/no-classes.ts","../src/rules/no-context-reassignment.ts","../src/rules/no-continue.ts","../src/lib/disallowed-methods.ts","../src/lib/function-utils.ts","../src/rules/no-disallowed-methods.ts","../src/rules/no-do-while.ts","../src/rules/no-for-loop.ts","../src/lib/callback-accepting-methods.ts","../src/rules/no-function-arguments.ts","../src/rules/no-function-reassign.ts","../src/rules/no-function-return.ts","../src/rules/no-generators.ts","../src/lib/global-constructors.ts","../src/rules/no-global-constructor.ts","../src/rules/no-in-operator.ts","../src/rules/no-instanceof.ts","../src/rules/no-labeled-statement.ts","../src/rules/no-new.ts","../src/rules/no-promise.ts","../src/rules/no-recursion.ts","../src/rules/no-regex.ts","../src/rules/no-this.ts","../src/rules/no-throw.ts","../src/rules/no-try.ts","../src/rules/no-update-operators.ts","../src/rules/no-while.ts","../src/rules/index.ts","../src/plugin.ts","../src/index.ts"],"sourcesContent":["export const APPSYNC_GLOBAL_NAMES = new Set([\n \"util\",\n \"extensions\",\n \"runtime\",\n]);\n","import type { CreateOnceRule } from \"@oxlint/plugins\";\n\nexport type AppsyncRuleModule = CreateOnceRule;\n\nexport function defineAppsyncRule(rule: AppsyncRuleModule): AppsyncRuleModule {\n return rule;\n}\n","import type { Context, ESTree, Scope } from \"@oxlint/plugins\";\nimport { APPSYNC_GLOBAL_NAMES } from \"../lib/appsync-globals.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nfunction isBindingPosition(node: ESTree.Node): boolean {\n const parent = node.parent;\n if (!parent) {\n return false;\n }\n\n if (\n parent.type === \"VariableDeclarator\" ||\n parent.type === \"FunctionDeclaration\" ||\n parent.type === \"FunctionExpression\" ||\n parent.type === \"ClassDeclaration\"\n ) {\n return parent.id === node;\n }\n\n if (\n parent.type === \"ImportSpecifier\" ||\n parent.type === \"ImportDefaultSpecifier\" ||\n parent.type === \"ImportNamespaceSpecifier\"\n ) {\n return parent.local === node;\n }\n\n if (parent.type === \"CatchClause\") {\n return parent.param === node;\n }\n\n return false;\n}\n\nfunction isNonReferencePosition(node: ESTree.Node): boolean {\n const parent = node.parent;\n if (!parent) {\n return false;\n }\n\n if (parent.type === \"Property\" && parent.key === node && !parent.computed) {\n return true;\n }\n\n if (\n parent.type === \"MemberExpression\" &&\n parent.property === node &&\n !parent.computed\n ) {\n return true;\n }\n\n return isBindingPosition(node);\n}\n\nfunction hasLocalBinding(\n node: { name: string },\n context: Context,\n): boolean {\n let scope: Scope | null = context.sourceCode.getScope(\n node as ESTree.IdentifierReference,\n );\n while (scope) {\n const variable = scope.set.get(node.name);\n if (variable && variable.defs.length > 0) {\n return true;\n }\n scope = scope.upper;\n }\n\n return false;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow AppSync-only globals in code that must run outside the AppSync runtime\",\n },\n messages: {\n default:\n \"AppSync global `{{name}}` is not available outside the AppSync runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n Identifier(node) {\n if (!APPSYNC_GLOBAL_NAMES.has(node.name)) {\n return;\n }\n\n if (isNonReferencePosition(node)) {\n return;\n }\n\n if (hasLocalBinding(node, context)) {\n return;\n }\n\n context.report({\n node,\n messageId: \"default\",\n data: { name: node.name },\n });\n },\n };\n },\n});\n","import type { Context, ESTree } from \"@oxlint/plugins\";\n\ntype NodeWithType = { type: string };\n\nexport function isIdentifier(\n node: NodeWithType | null | undefined,\n name: string,\n): boolean {\n return (\n node?.type === \"Identifier\" &&\n (node as unknown as { name: string }).name === name\n );\n}\n\nexport function reportDefault(\n context: Context,\n node: ESTree.Node,\n messageId = \"default\",\n): void {\n context.report({ node, messageId });\n}\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow async functions and await expressions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Promises and async/await are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const reportAsyncFunction = (node: { async?: boolean }) => {\n if (node.async) {\n reportDefault(context, node as never);\n }\n };\n\n return {\n AwaitExpression(node) {\n reportDefault(context, node);\n },\n FunctionDeclaration: reportAsyncFunction,\n FunctionExpression: reportAsyncFunction,\n ArrowFunctionExpression: reportAsyncFunction,\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the bitwise NOT (~) operator in AppSync resolvers\",\n },\n messages: {\n default: \"The ~ operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n UnaryExpression(node) {\n if (node.operator === \"~\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow class declarations and expressions in AppSync resolvers\",\n },\n messages: {\n default: \"Classes are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ClassDeclaration(node) {\n reportDefault(context, node);\n },\n ClassExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import type { ESTree } from \"@oxlint/plugins\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { isIdentifier, reportDefault } from \"../lib/utils.js\";\n\nfunction isContextAssignmentTarget(node: ESTree.Node): boolean {\n if (isIdentifier(node, \"context\")) {\n return true;\n }\n\n return (\n node.type === \"MemberExpression\" && isIdentifier(node.object, \"context\")\n );\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow reassigning context and its base properties in AppSync resolvers\",\n },\n messages: {\n default:\n \"Reassigning context and base properties of context is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n AssignmentExpression(node) {\n if (isContextAssignmentTarget(node.left)) {\n reportDefault(context, node.left);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow continue statements in AppSync resolvers\",\n },\n messages: {\n default: \"continue statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ContinueStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","export const DISALLOWED_METHOD_NAMES = new Set([\"apply\", \"bind\", \"call\"]);\n","import type { Context, Definition, ESTree, Scope } from \"@oxlint/plugins\";\n\ntype FunctionNode = ESTree.Node & {\n type:\n | \"FunctionDeclaration\"\n | \"FunctionExpression\"\n | \"ArrowFunctionExpression\";\n id?: { name: string } | null;\n};\n\nexport function getMemberPropertyName(\n property: ESTree.Node & { type: string },\n): string | null {\n if (property.type === \"Identifier\") {\n return (property as unknown as { name: string }).name;\n }\n\n if (property.type === \"Literal\" && typeof property.value === \"string\") {\n return property.value;\n }\n\n return null;\n}\n\nexport function definitionCreatesFunction(def: Definition): boolean {\n if (def.type === \"FunctionName\") {\n return true;\n }\n\n if (def.type === \"Variable\" && def.node.type === \"VariableDeclarator\") {\n const init = def.node.init;\n if (!init) {\n return false;\n }\n\n return (\n init.type === \"FunctionExpression\" ||\n init.type === \"ArrowFunctionExpression\"\n );\n }\n\n return false;\n}\n\nexport function isFunctionNode(node: ESTree.Node): node is FunctionNode {\n return (\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n );\n}\n\nexport function isFunctionLikeNode(\n node: ESTree.Node,\n context: Context,\n): boolean {\n if (\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return true;\n }\n\n if (node.type !== \"Identifier\") {\n return false;\n }\n\n return variableHoldsFunction(node.name, context, node);\n}\n\nexport function variableHoldsFunction(\n name: string,\n context: Context,\n referenceNode: ESTree.Node,\n): boolean {\n let scope: Scope | null = context.sourceCode.getScope(referenceNode);\n while (scope) {\n const variable = scope.set.get(name);\n if (variable?.defs.some(definitionCreatesFunction)) {\n return true;\n }\n scope = scope.upper;\n }\n\n return false;\n}\n","import { DISALLOWED_METHOD_NAMES } from \"../lib/disallowed-methods.js\";\nimport { getMemberPropertyName } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow unsupported method calls such as call, apply, and bind\",\n },\n messages: {\n default:\n \"The {{method}}() method is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type !== \"MemberExpression\") {\n return;\n }\n\n const method = getMemberPropertyName(node.callee.property);\n if (method && DISALLOWED_METHOD_NAMES.has(method)) {\n context.report({\n node,\n messageId: \"default\",\n data: { method },\n });\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow do-while loops in AppSync resolvers\",\n },\n messages: {\n default: \"do-while loops are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n DoWhileStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow C-style for loops in AppSync resolvers (for-in and for-of are allowed)\",\n },\n messages: {\n default:\n \"Only for-in and for-of loops are supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ForStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","export const CALLBACK_ACCEPTING_METHODS = new Set([\n \"map\",\n \"find\",\n \"filter\",\n \"findIndex\",\n \"findLast\",\n \"findLastIndex\",\n \"forEach\",\n \"reduce\",\n \"reduceRight\",\n \"every\",\n \"some\",\n \"flatMap\",\n]);\n","import type { Context, ESTree, Scope } from \"@oxlint/plugins\";\nimport { CALLBACK_ACCEPTING_METHODS } from \"../lib/callback-accepting-methods.js\";\nimport {\n definitionCreatesFunction,\n getMemberPropertyName,\n} from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nfunction isCallbackAcceptingCall(callee: ESTree.Node): boolean {\n if (callee.type !== \"MemberExpression\") {\n return false;\n }\n\n const member = callee as\n | ESTree.StaticMemberExpression\n | ESTree.ComputedMemberExpression;\n const propertyName = getMemberPropertyName(member.property);\n return propertyName !== null && CALLBACK_ACCEPTING_METHODS.has(propertyName);\n}\n\nfunction isFunctionLikeArgument(node: ESTree.Node, context: Context): boolean {\n if (\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return true;\n }\n\n if (node.type !== \"Identifier\") {\n return false;\n }\n\n let scope: Scope | null = context.sourceCode.getScope(node);\n while (scope) {\n const variable = scope.set.get(node.name);\n if (variable?.defs.some(definitionCreatesFunction)) {\n return true;\n }\n scope = scope.upper ?? null;\n }\n\n return false;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow passing functions as call arguments except to allowlisted Array methods\",\n },\n messages: {\n default: \"Functions can not be passed as an argument\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const allowsCallbacks = isCallbackAcceptingCall(node.callee);\n\n for (const argument of node.arguments) {\n if (argument.type === \"SpreadElement\") {\n continue;\n }\n\n if (argument.type === \"ArrowFunctionExpression\" && allowsCallbacks) {\n continue;\n }\n\n if (isFunctionLikeArgument(argument, context)) {\n reportDefault(context, argument);\n }\n }\n },\n };\n },\n});\n","import { variableHoldsFunction } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow reassigning function variables in AppSync resolvers\",\n },\n messages: {\n default: \"Functions cannot be reassigned in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n AssignmentExpression(node) {\n if (node.left.type !== \"Identifier\") {\n return;\n }\n\n if (variableHoldsFunction(node.left.name, context, node.left)) {\n reportDefault(context, node.left);\n }\n },\n };\n },\n});\n","import { isFunctionLikeNode } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow returning functions from functions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Functions cannot be the return value of functions in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ReturnStatement(node) {\n if (!node.argument) {\n return;\n }\n\n if (isFunctionLikeNode(node.argument, context)) {\n reportDefault(context, node.argument);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow generator functions in AppSync resolvers\",\n },\n messages: {\n default: \"Generators are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const reportGenerator = (node: { generator?: boolean }) => {\n if (node.generator) {\n reportDefault(context, node as never);\n }\n };\n\n return {\n FunctionDeclaration: reportGenerator,\n FunctionExpression: reportGenerator,\n };\n },\n});\n","export const GLOBAL_CONSTRUCTOR_NAMES = new Set([\n \"String\",\n \"Boolean\",\n \"Number\",\n \"BigInt\",\n \"Symbol\",\n \"Date\",\n \"Object\",\n \"Array\",\n \"Function\",\n \"RegExp\",\n]);\n","import { GLOBAL_CONSTRUCTOR_NAMES } from \"../lib/global-constructors.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow calling global constructor functions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Do not use `{{name}}()` as a constructor in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (\n node.callee.type === \"Identifier\" &&\n GLOBAL_CONSTRUCTOR_NAMES.has(node.callee.name)\n ) {\n context.report({\n node,\n messageId: \"default\",\n data: { name: node.callee.name },\n });\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the in operator in AppSync resolvers\",\n },\n messages: {\n default:\n \"The in operator is not supported in the AppSync JS runtime; use Object.hasOwn instead\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n BinaryExpression(node) {\n if (node.operator === \"in\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the instanceof operator in AppSync resolvers\",\n },\n messages: {\n default: \"The instanceof operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n BinaryExpression(node) {\n if (node.operator === \"instanceof\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow labeled statements in AppSync resolvers\",\n },\n messages: {\n default: \"Labeled statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n LabeledStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the new operator in AppSync resolvers\",\n },\n messages: {\n default: \"The new operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n NewExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { isIdentifier, reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow Promise usage in AppSync resolvers\",\n },\n messages: {\n default: \"Promises are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const { callee } = node;\n\n if (\n isIdentifier(callee, \"Promise\") ||\n (callee.type === \"MemberExpression\" &&\n isIdentifier(callee.object, \"Promise\"))\n ) {\n reportDefault(context, node);\n }\n },\n NewExpression(node) {\n if (isIdentifier(node.callee, \"Promise\")) {\n reportDefault(context, node);\n }\n },\n VariableDeclarator(node) {\n if (node.init && isIdentifier(node.init, \"Promise\")) {\n reportDefault(context, node.init);\n }\n },\n AssignmentExpression(node) {\n if (isIdentifier(node.right, \"Promise\")) {\n reportDefault(context, node.right);\n }\n },\n };\n },\n});\n","import type { Context, ESTree } from \"@oxlint/plugins\";\nimport { isFunctionNode } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nfunction getEnclosingBindingNames(\n node: ESTree.Node,\n context: Context,\n): Set<string> {\n const names = new Set<string>();\n\n if (\n (node.type === \"FunctionDeclaration\" || node.type === \"FunctionExpression\") &&\n node.id?.type === \"Identifier\"\n ) {\n names.add(node.id.name);\n }\n\n let scope = context.sourceCode.getScope(node).upper;\n while (scope) {\n for (const variable of scope.variables) {\n for (const def of variable.defs) {\n if (\n def.type === \"Variable\" &&\n def.node.type === \"VariableDeclarator\" &&\n def.node.init === node\n ) {\n names.add(variable.name);\n }\n }\n }\n scope = scope.upper;\n }\n\n return names;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow recursive function calls in AppSync resolvers\",\n },\n messages: {\n default: \"Recursive function calls are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const enclosingBindingNames: Set<string>[] = [];\n\n const enterFunction = (node: ESTree.Node) => {\n if (!isFunctionNode(node)) {\n return;\n }\n\n enclosingBindingNames.push(getEnclosingBindingNames(node, context));\n };\n\n const exitFunction = (node: ESTree.Node) => {\n if (!isFunctionNode(node)) {\n return;\n }\n\n enclosingBindingNames.pop();\n };\n\n return {\n FunctionDeclaration: enterFunction,\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression: enterFunction,\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression: enterFunction,\n \"ArrowFunctionExpression:exit\": exitFunction,\n CallExpression(node) {\n if (node.callee.type !== \"Identifier\") {\n return;\n }\n\n const currentBindings =\n enclosingBindingNames[enclosingBindingNames.length - 1];\n if (currentBindings?.has(node.callee.name)) {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow regex literals in AppSync resolvers\",\n },\n messages: {\n default: \"Regex literals are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n Literal(node) {\n if (\"regex\" in node && node.regex) {\n reportDefault(context, node);\n }\n },\n RegExpLiteral(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow this expressions in AppSync resolvers\",\n },\n messages: {\n default: \"this is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ThisExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow throw statements in AppSync resolvers\",\n },\n messages: {\n default: \"throw statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ThrowStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow try/catch/finally statements in AppSync resolvers\",\n },\n messages: {\n default:\n \"try/catch/finally statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n TryStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow ++ and -- operators in AppSync resolvers\",\n },\n messages: {\n default: \"++ and -- operators are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n UpdateExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow while loops in AppSync resolvers\",\n },\n messages: {\n default: \"while loops are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n WhileStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import noAppsyncGlobals from \"./no-appsync-globals.js\";\nimport noAsyncAwait from \"./no-async-await.js\";\nimport noBitwiseNot from \"./no-bitwise-not.js\";\nimport noClasses from \"./no-classes.js\";\nimport noContextReassignment from \"./no-context-reassignment.js\";\nimport noContinue from \"./no-continue.js\";\nimport noDisallowedMethods from \"./no-disallowed-methods.js\";\nimport noDoWhile from \"./no-do-while.js\";\nimport noForLoop from \"./no-for-loop.js\";\nimport noFunctionArguments from \"./no-function-arguments.js\";\nimport noFunctionReassign from \"./no-function-reassign.js\";\nimport noFunctionReturn from \"./no-function-return.js\";\nimport noGenerators from \"./no-generators.js\";\nimport noGlobalConstructor from \"./no-global-constructor.js\";\nimport noInOperator from \"./no-in-operator.js\";\nimport noInstanceof from \"./no-instanceof.js\";\nimport noLabeledStatement from \"./no-labeled-statement.js\";\nimport noNew from \"./no-new.js\";\nimport noPromise from \"./no-promise.js\";\nimport noRecursion from \"./no-recursion.js\";\nimport noRegex from \"./no-regex.js\";\nimport noThis from \"./no-this.js\";\nimport noThrow from \"./no-throw.js\";\nimport noTry from \"./no-try.js\";\nimport noUpdateOperators from \"./no-update-operators.js\";\nimport noWhile from \"./no-while.js\";\nimport type { AppsyncRuleModule } from \"../lib/rule-types.js\";\n\nconst rules = {\n \"no-appsync-globals\": noAppsyncGlobals,\n \"no-async-await\": noAsyncAwait,\n \"no-bitwise-not\": noBitwiseNot,\n \"no-classes\": noClasses,\n \"no-context-reassignment\": noContextReassignment,\n \"no-continue\": noContinue,\n \"no-do-while\": noDoWhile,\n \"no-disallowed-methods\": noDisallowedMethods,\n \"no-for-loop\": noForLoop,\n \"no-function-arguments\": noFunctionArguments,\n \"no-function-reassign\": noFunctionReassign,\n \"no-function-return\": noFunctionReturn,\n \"no-generators\": noGenerators,\n \"no-in-operator\": noInOperator,\n \"no-instanceof\": noInstanceof,\n \"no-labeled-statement\": noLabeledStatement,\n \"no-new\": noNew,\n \"no-promise\": noPromise,\n \"no-recursion\": noRecursion,\n \"no-regex\": noRegex,\n \"no-global-constructor\": noGlobalConstructor,\n \"no-this\": noThis,\n \"no-throw\": noThrow,\n \"no-try\": noTry,\n \"no-update-operators\": noUpdateOperators,\n \"no-while\": noWhile,\n} satisfies Record<string, AppsyncRuleModule>;\n\nexport type AppsyncRuleName = keyof typeof rules;\n\nexport default rules;\n","import { eslintCompatPlugin } from \"@oxlint/plugins\";\nimport rules from \"./rules/index.js\";\n\nconst OPT_IN_RULES = new Set([\"no-appsync-globals\"]);\n\nexport const plugin = eslintCompatPlugin({\n meta: {\n name: \"appsync\",\n },\n rules,\n});\n\nexport const recommended = Object.fromEntries(\n Object.keys(rules)\n .filter((ruleName) => !OPT_IN_RULES.has(ruleName))\n .map((ruleName) => [`appsync/${ruleName}`, \"error\"]),\n) as Record<`appsync/${Exclude<keyof typeof rules, \"no-appsync-globals\">}`, \"error\">;\n\nexport const portable = {\n ...recommended,\n \"appsync/no-appsync-globals\": \"error\",\n} as const;\n","import { plugin, portable, recommended } from \"./plugin.js\";\n\nexport { plugin, portable, recommended };\nexport default plugin;\n"],"mappings":";;AAAA,MAAa,uCAAuB,IAAI,IAAI;CAC1C;CACA;CACA;AACF,CAAC;;;ACAD,SAAgB,kBAAkB,MAA4C;CAC5E,OAAO;AACT;;;ACFA,SAAS,kBAAkB,MAA4B;CACrD,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QACH,OAAO;CAGT,IACE,OAAO,SAAS,wBAChB,OAAO,SAAS,yBAChB,OAAO,SAAS,wBAChB,OAAO,SAAS,oBAEhB,OAAO,OAAO,OAAO;CAGvB,IACE,OAAO,SAAS,qBAChB,OAAO,SAAS,4BAChB,OAAO,SAAS,4BAEhB,OAAO,OAAO,UAAU;CAG1B,IAAI,OAAO,SAAS,eAClB,OAAO,OAAO,UAAU;CAG1B,OAAO;AACT;AAEA,SAAS,uBAAuB,MAA4B;CAC1D,MAAM,SAAS,KAAK;CACpB,IAAI,CAAC,QACH,OAAO;CAGT,IAAI,OAAO,SAAS,cAAc,OAAO,QAAQ,QAAQ,CAAC,OAAO,UAC/D,OAAO;CAGT,IACE,OAAO,SAAS,sBAChB,OAAO,aAAa,QACpB,CAAC,OAAO,UAER,OAAO;CAGT,OAAO,kBAAkB,IAAI;AAC/B;AAEA,SAAS,gBACP,MACA,SACS;CACT,IAAI,QAAsB,QAAQ,WAAW,SAC3C,IACF;CACA,OAAO,OAAO;EACZ,MAAM,WAAW,MAAM,IAAI,IAAI,KAAK,IAAI;EACxC,IAAI,YAAY,SAAS,KAAK,SAAS,GACrC,OAAO;EAET,QAAQ,MAAM;CAChB;CAEA,O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WAAW,YAAY,OAAO,CAAC,CACvD;AAEA,MAAa,WAAW;CACtB,GAAG;CACH,8BAA8B;AAChC;;;AClBA,IAAA,cAAe"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["member","noAppsyncGlobals","noAsyncAwait","noBitwiseNot","noClasses","noContextReassignment","noContinue","noDoWhile","noDisallowedMethods","noForLoop","noFunctionArguments","noFunctionReassign","noFunctionReturn","noGenerators","noInOperator","noInstanceof","noLabeledStatement","noNew","noPromise","noRecursion","noRegex","noGlobalConstructor","noThis","noThrow","noTry","noUpdateOperators","noWhile"],"sources":["../src/lib/appsync-globals.ts","../src/lib/rule-types.ts","../src/rules/no-appsync-globals.ts","../src/lib/utils.ts","../src/rules/no-async-await.ts","../src/rules/no-bitwise-not.ts","../src/rules/no-classes.ts","../src/rules/no-context-reassignment.ts","../src/rules/no-continue.ts","../src/lib/disallowed-methods.ts","../src/lib/function-utils.ts","../src/rules/no-disallowed-methods.ts","../src/rules/no-do-while.ts","../src/rules/no-for-loop.ts","../src/lib/callback-accepting-methods.ts","../src/rules/no-function-arguments.ts","../src/rules/no-function-reassign.ts","../src/rules/no-function-return.ts","../src/rules/no-generators.ts","../src/lib/global-constructors.ts","../src/rules/no-global-constructor.ts","../src/rules/no-in-operator.ts","../src/rules/no-instanceof.ts","../src/rules/no-labeled-statement.ts","../src/rules/no-new.ts","../src/rules/no-promise.ts","../src/rules/no-recursion.ts","../src/rules/no-regex.ts","../src/rules/no-this.ts","../src/rules/no-throw.ts","../src/rules/no-try.ts","../src/rules/no-update-operators.ts","../src/rules/no-while.ts","../src/rules/index.ts","../src/plugin.ts","../src/index.ts"],"sourcesContent":["export const APPSYNC_GLOBAL_NAMES = new Set([\n \"util\",\n \"extensions\",\n \"runtime\",\n]);\n","import type { CreateOnceRule } from \"@oxlint/plugins\";\n\nexport type AppsyncRuleModule = CreateOnceRule;\n\nexport function defineAppsyncRule(rule: AppsyncRuleModule): AppsyncRuleModule {\n return rule;\n}\n","import type { Context, ESTree, Scope } from \"@oxlint/plugins\";\nimport { APPSYNC_GLOBAL_NAMES } from \"../lib/appsync-globals.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nfunction isBindingPosition(node: ESTree.Node): boolean {\n const parent = node.parent;\n if (!parent) {\n return false;\n }\n\n if (\n parent.type === \"VariableDeclarator\" ||\n parent.type === \"FunctionDeclaration\" ||\n parent.type === \"FunctionExpression\" ||\n parent.type === \"ClassDeclaration\"\n ) {\n return parent.id === node;\n }\n\n if (\n parent.type === \"ImportSpecifier\" ||\n parent.type === \"ImportDefaultSpecifier\" ||\n parent.type === \"ImportNamespaceSpecifier\"\n ) {\n return parent.local === node;\n }\n\n if (parent.type === \"CatchClause\") {\n return parent.param === node;\n }\n\n return false;\n}\n\nfunction isNonReferencePosition(node: ESTree.Node): boolean {\n const parent = node.parent;\n if (!parent) {\n return false;\n }\n\n if (parent.type === \"Property\" && parent.key === node && !parent.computed) {\n return true;\n }\n\n if (\n parent.type === \"MemberExpression\" &&\n parent.property === node &&\n !parent.computed\n ) {\n return true;\n }\n\n return isBindingPosition(node);\n}\n\nfunction hasLocalBinding(\n node: { name: string },\n context: Context,\n): boolean {\n let scope: Scope | null = context.sourceCode.getScope(\n node as ESTree.IdentifierReference,\n );\n while (scope) {\n const variable = scope.set.get(node.name);\n if (variable && variable.defs.length > 0) {\n return true;\n }\n scope = scope.upper;\n }\n\n return false;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow AppSync-only globals in code that must run outside the AppSync runtime\",\n },\n messages: {\n default:\n \"AppSync global `{{name}}` is not available outside the AppSync runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n Identifier(node) {\n if (!APPSYNC_GLOBAL_NAMES.has(node.name)) {\n return;\n }\n\n if (isNonReferencePosition(node)) {\n return;\n }\n\n if (hasLocalBinding(node, context)) {\n return;\n }\n\n context.report({\n node,\n messageId: \"default\",\n data: { name: node.name },\n });\n },\n };\n },\n});\n","import type { Context, ESTree } from \"@oxlint/plugins\";\n\ntype NodeWithType = { type: string };\n\nexport function isIdentifier(\n node: NodeWithType | null | undefined,\n name: string,\n): boolean {\n return (\n node?.type === \"Identifier\" &&\n (node as unknown as { name: string }).name === name\n );\n}\n\nexport function reportDefault(\n context: Context,\n node: ESTree.Node,\n messageId = \"default\",\n): void {\n context.report({ node, messageId });\n}\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow async functions and await expressions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Promises and async/await are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const reportAsyncFunction = (node: { async?: boolean }) => {\n if (node.async) {\n reportDefault(context, node as never);\n }\n };\n\n return {\n AwaitExpression(node) {\n reportDefault(context, node);\n },\n FunctionDeclaration: reportAsyncFunction,\n FunctionExpression: reportAsyncFunction,\n ArrowFunctionExpression: reportAsyncFunction,\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the bitwise NOT (~) operator in AppSync resolvers\",\n },\n messages: {\n default: \"The ~ operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n UnaryExpression(node) {\n if (node.operator === \"~\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow class declarations and expressions in AppSync resolvers\",\n },\n messages: {\n default: \"Classes are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ClassDeclaration(node) {\n reportDefault(context, node);\n },\n ClassExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import type { ESTree } from \"@oxlint/plugins\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { isIdentifier, reportDefault } from \"../lib/utils.js\";\n\nfunction isContextAssignmentTarget(node: ESTree.Node): boolean {\n if (isIdentifier(node, \"context\")) {\n return true;\n }\n\n return (\n node.type === \"MemberExpression\" && isIdentifier(node.object, \"context\")\n );\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow reassigning context and its base properties in AppSync resolvers\",\n },\n messages: {\n default:\n \"Reassigning context and base properties of context is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n AssignmentExpression(node) {\n if (isContextAssignmentTarget(node.left)) {\n reportDefault(context, node.left);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow continue statements in AppSync resolvers\",\n },\n messages: {\n default: \"continue statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ContinueStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","export const DISALLOWED_METHOD_NAMES = new Set([\"apply\", \"bind\", \"call\"]);\n","import type { Context, Definition, ESTree, Scope } from \"@oxlint/plugins\";\n\ntype FunctionNode = ESTree.Node & {\n type:\n | \"FunctionDeclaration\"\n | \"FunctionExpression\"\n | \"ArrowFunctionExpression\";\n id?: { name: string } | null;\n};\n\nexport function getMemberPropertyName(\n property: ESTree.Node & { type: string },\n): string | null {\n if (property.type === \"Identifier\") {\n return (property as unknown as { name: string }).name;\n }\n\n if (property.type === \"Literal\" && typeof property.value === \"string\") {\n return property.value;\n }\n\n return null;\n}\n\nexport function definitionCreatesFunction(def: Definition): boolean {\n if (def.type === \"FunctionName\") {\n return true;\n }\n\n if (def.type === \"Variable\" && def.node.type === \"VariableDeclarator\") {\n const init = def.node.init;\n if (!init) {\n return false;\n }\n\n return (\n init.type === \"FunctionExpression\" ||\n init.type === \"ArrowFunctionExpression\"\n );\n }\n\n return false;\n}\n\nexport function isFunctionNode(node: ESTree.Node): node is FunctionNode {\n return (\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n );\n}\n\nexport function isFunctionLikeNode(\n node: ESTree.Node,\n context: Context,\n): boolean {\n if (\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return true;\n }\n\n if (node.type !== \"Identifier\") {\n return false;\n }\n\n return variableHoldsFunction(node.name, context, node);\n}\n\nexport function variableHoldsFunction(\n name: string,\n context: Context,\n referenceNode: ESTree.Node,\n): boolean {\n let scope: Scope | null = context.sourceCode.getScope(referenceNode);\n while (scope) {\n const variable = scope.set.get(name);\n if (variable) {\n return variable.defs.some(definitionCreatesFunction);\n }\n scope = scope.upper;\n }\n\n return false;\n}\n","import { DISALLOWED_METHOD_NAMES } from \"../lib/disallowed-methods.js\";\nimport { getMemberPropertyName } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow unsupported method calls such as call, apply, and bind\",\n },\n messages: {\n default:\n \"The {{method}}() method is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type !== \"MemberExpression\") {\n return;\n }\n\n const method = getMemberPropertyName(node.callee.property);\n if (method && DISALLOWED_METHOD_NAMES.has(method)) {\n context.report({\n node,\n messageId: \"default\",\n data: { method },\n });\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow do-while loops in AppSync resolvers\",\n },\n messages: {\n default: \"do-while loops are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n DoWhileStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow C-style for loops in AppSync resolvers (for-in and for-of are allowed)\",\n },\n messages: {\n default:\n \"Only for-in and for-of loops are supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ForStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","export const CALLBACK_ACCEPTING_METHODS = new Set([\n \"map\",\n \"find\",\n \"filter\",\n \"findIndex\",\n \"findLast\",\n \"findLastIndex\",\n \"forEach\",\n \"reduce\",\n \"reduceRight\",\n \"every\",\n \"some\",\n \"flatMap\",\n]);\n","import type { Context, ESTree, Scope } from \"@oxlint/plugins\";\nimport { CALLBACK_ACCEPTING_METHODS } from \"../lib/callback-accepting-methods.js\";\nimport {\n definitionCreatesFunction,\n getMemberPropertyName,\n} from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nfunction isCallbackAcceptingCall(callee: ESTree.Node): boolean {\n if (callee.type !== \"MemberExpression\") {\n return false;\n }\n\n const member = callee as\n | ESTree.StaticMemberExpression\n | ESTree.ComputedMemberExpression;\n const propertyName = getMemberPropertyName(member.property);\n return propertyName !== null && CALLBACK_ACCEPTING_METHODS.has(propertyName);\n}\n\nfunction isFunctionLikeArgument(node: ESTree.Node, context: Context): boolean {\n if (\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n ) {\n return true;\n }\n\n if (node.type !== \"Identifier\") {\n return false;\n }\n\n let scope: Scope | null = context.sourceCode.getScope(node);\n while (scope) {\n const variable = scope.set.get(node.name);\n if (variable?.defs.some(definitionCreatesFunction)) {\n return true;\n }\n scope = scope.upper ?? null;\n }\n\n return false;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow passing functions as call arguments except to allowlisted Array methods\",\n },\n messages: {\n default: \"Functions can not be passed as an argument\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const allowsCallbacks = isCallbackAcceptingCall(node.callee);\n\n for (const argument of node.arguments) {\n if (argument.type === \"SpreadElement\") {\n continue;\n }\n\n if (argument.type === \"ArrowFunctionExpression\" && allowsCallbacks) {\n continue;\n }\n\n if (isFunctionLikeArgument(argument, context)) {\n reportDefault(context, argument);\n }\n }\n },\n };\n },\n});\n","import { variableHoldsFunction } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow reassigning function variables in AppSync resolvers\",\n },\n messages: {\n default: \"Functions cannot be reassigned in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n AssignmentExpression(node) {\n if (node.left.type !== \"Identifier\") {\n return;\n }\n\n if (variableHoldsFunction(node.left.name, context, node.left)) {\n reportDefault(context, node.left);\n }\n },\n };\n },\n});\n","import { isFunctionLikeNode } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow returning functions from functions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Functions cannot be the return value of functions in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ReturnStatement(node) {\n if (!node.argument) {\n return;\n }\n\n if (isFunctionLikeNode(node.argument, context)) {\n reportDefault(context, node.argument);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow generator functions in AppSync resolvers\",\n },\n messages: {\n default: \"Generators are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const reportGenerator = (node: { generator?: boolean }) => {\n if (node.generator) {\n reportDefault(context, node as never);\n }\n };\n\n return {\n FunctionDeclaration: reportGenerator,\n FunctionExpression: reportGenerator,\n };\n },\n});\n","export const GLOBAL_CONSTRUCTOR_NAMES = new Set([\n \"String\",\n \"Boolean\",\n \"Number\",\n \"BigInt\",\n \"Symbol\",\n \"Date\",\n \"Object\",\n \"Array\",\n \"Function\",\n \"RegExp\",\n]);\n","import { GLOBAL_CONSTRUCTOR_NAMES } from \"../lib/global-constructors.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow calling global constructor functions in AppSync resolvers\",\n },\n messages: {\n default:\n \"Do not use `{{name}}()` as a constructor in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (\n node.callee.type === \"Identifier\" &&\n GLOBAL_CONSTRUCTOR_NAMES.has(node.callee.name)\n ) {\n context.report({\n node,\n messageId: \"default\",\n data: { name: node.callee.name },\n });\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the in operator in AppSync resolvers\",\n },\n messages: {\n default:\n \"The in operator is not supported in the AppSync JS runtime; use Object.hasOwn instead\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n BinaryExpression(node) {\n if (node.operator === \"in\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the instanceof operator in AppSync resolvers\",\n },\n messages: {\n default: \"The instanceof operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n BinaryExpression(node) {\n if (node.operator === \"instanceof\") {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow labeled statements in AppSync resolvers\",\n },\n messages: {\n default: \"Labeled statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n LabeledStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the new operator in AppSync resolvers\",\n },\n messages: {\n default: \"The new operator is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n NewExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { isIdentifier, reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow Promise usage in AppSync resolvers\",\n },\n messages: {\n default: \"Promises are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const { callee } = node;\n\n if (\n isIdentifier(callee, \"Promise\") ||\n (callee.type === \"MemberExpression\" &&\n isIdentifier(callee.object, \"Promise\"))\n ) {\n reportDefault(context, node);\n }\n },\n NewExpression(node) {\n if (isIdentifier(node.callee, \"Promise\")) {\n reportDefault(context, node);\n }\n },\n VariableDeclarator(node) {\n if (node.init && isIdentifier(node.init, \"Promise\")) {\n reportDefault(context, node.init);\n }\n },\n AssignmentExpression(node) {\n if (isIdentifier(node.right, \"Promise\")) {\n reportDefault(context, node.right);\n }\n },\n };\n },\n});\n","import type { Context, ESTree } from \"@oxlint/plugins\";\nimport { isFunctionNode } from \"../lib/function-utils.js\";\nimport { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nfunction getEnclosingBindingNames(\n node: ESTree.Node,\n context: Context,\n): Set<string> {\n const names = new Set<string>();\n\n if (\n (node.type === \"FunctionDeclaration\" || node.type === \"FunctionExpression\") &&\n node.id?.type === \"Identifier\"\n ) {\n names.add(node.id.name);\n }\n\n let scope = context.sourceCode.getScope(node).upper;\n while (scope) {\n for (const variable of scope.variables) {\n for (const def of variable.defs) {\n if (\n def.type === \"Variable\" &&\n def.node.type === \"VariableDeclarator\" &&\n def.node.init === node\n ) {\n names.add(variable.name);\n }\n }\n }\n scope = scope.upper;\n }\n\n return names;\n}\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow recursive function calls in AppSync resolvers\",\n },\n messages: {\n default: \"Recursive function calls are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n const enclosingBindingNames: Set<string>[] = [];\n\n const enterFunction = (node: ESTree.Node) => {\n if (!isFunctionNode(node)) {\n return;\n }\n\n enclosingBindingNames.push(getEnclosingBindingNames(node, context));\n };\n\n const exitFunction = (node: ESTree.Node) => {\n if (!isFunctionNode(node)) {\n return;\n }\n\n enclosingBindingNames.pop();\n };\n\n return {\n FunctionDeclaration: enterFunction,\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression: enterFunction,\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression: enterFunction,\n \"ArrowFunctionExpression:exit\": exitFunction,\n CallExpression(node) {\n if (node.callee.type !== \"Identifier\") {\n return;\n }\n\n const currentBindings =\n enclosingBindingNames[enclosingBindingNames.length - 1];\n if (currentBindings?.has(node.callee.name)) {\n reportDefault(context, node);\n }\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow regex literals in AppSync resolvers\",\n },\n messages: {\n default: \"Regex literals are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n Literal(node) {\n if (\"regex\" in node && node.regex) {\n reportDefault(context, node);\n }\n },\n RegExpLiteral(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow this expressions in AppSync resolvers\",\n },\n messages: {\n default: \"this is not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ThisExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow throw statements in AppSync resolvers\",\n },\n messages: {\n default: \"throw statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n ThrowStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow try/catch/finally statements in AppSync resolvers\",\n },\n messages: {\n default:\n \"try/catch/finally statements are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n TryStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow ++ and -- operators in AppSync resolvers\",\n },\n messages: {\n default: \"++ and -- operators are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n UpdateExpression(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import { defineAppsyncRule } from \"../lib/rule-types.js\";\nimport { reportDefault } from \"../lib/utils.js\";\n\nexport default defineAppsyncRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow while loops in AppSync resolvers\",\n },\n messages: {\n default: \"while loops are not supported in the AppSync JS runtime\",\n },\n schema: [],\n },\n createOnce(context) {\n return {\n WhileStatement(node) {\n reportDefault(context, node);\n },\n };\n },\n});\n","import noAppsyncGlobals from \"./no-appsync-globals.js\";\nimport noAsyncAwait from \"./no-async-await.js\";\nimport noBitwiseNot from \"./no-bitwise-not.js\";\nimport noClasses from \"./no-classes.js\";\nimport noContextReassignment from \"./no-context-reassignment.js\";\nimport noContinue from \"./no-continue.js\";\nimport noDisallowedMethods from \"./no-disallowed-methods.js\";\nimport noDoWhile from \"./no-do-while.js\";\nimport noForLoop from \"./no-for-loop.js\";\nimport noFunctionArguments from \"./no-function-arguments.js\";\nimport noFunctionReassign from \"./no-function-reassign.js\";\nimport noFunctionReturn from \"./no-function-return.js\";\nimport noGenerators from \"./no-generators.js\";\nimport noGlobalConstructor from \"./no-global-constructor.js\";\nimport noInOperator from \"./no-in-operator.js\";\nimport noInstanceof from \"./no-instanceof.js\";\nimport noLabeledStatement from \"./no-labeled-statement.js\";\nimport noNew from \"./no-new.js\";\nimport noPromise from \"./no-promise.js\";\nimport noRecursion from \"./no-recursion.js\";\nimport noRegex from \"./no-regex.js\";\nimport noThis from \"./no-this.js\";\nimport noThrow from \"./no-throw.js\";\nimport noTry from \"./no-try.js\";\nimport noUpdateOperators from \"./no-update-operators.js\";\nimport noWhile from \"./no-while.js\";\nimport type { AppsyncRuleModule } from \"../lib/rule-types.js\";\n\nconst rules = {\n \"no-appsync-globals\": noAppsyncGlobals,\n \"no-async-await\": noAsyncAwait,\n \"no-bitwise-not\": noBitwiseNot,\n \"no-classes\": noClasses,\n \"no-context-reassignment\": noContextReassignment,\n \"no-continue\": noContinue,\n \"no-do-while\": noDoWhile,\n \"no-disallowed-methods\": noDisallowedMethods,\n \"no-for-loop\": noForLoop,\n \"no-function-arguments\": noFunctionArguments,\n \"no-function-reassign\": noFunctionReassign,\n \"no-function-return\": noFunctionReturn,\n \"no-generators\": noGenerators,\n \"no-in-operator\": noInOperator,\n \"no-instanceof\": noInstanceof,\n \"no-labeled-statement\": noLabeledStatement,\n \"no-new\": noNew,\n \"no-promise\": noPromise,\n \"no-recursion\": noRecursion,\n \"no-regex\": noRegex,\n \"no-global-constructor\": noGlobalConstructor,\n \"no-this\": noThis,\n \"no-throw\": noThrow,\n \"no-try\": noTry,\n \"no-update-operators\": noUpdateOperators,\n \"no-while\": noWhile,\n} satisfies Record<string, AppsyncRuleModule>;\n\nexport type AppsyncRuleName = keyof typeof rules;\n\nexport default rules;\n","import { eslintCompatPlugin } from \"@oxlint/plugins\";\nimport rules from \"./rules/index.js\";\n\nconst OPT_IN_RULES = new Set([\"no-appsync-globals\"]);\n\nexport const plugin = eslintCompatPlugin({\n meta: {\n name: \"appsync\",\n },\n rules,\n});\n\nexport const recommended = Object.fromEntries(\n Object.keys(rules)\n .filter((ruleName) => !OPT_IN_RULES.has(ruleName))\n .map((ruleName) => [`appsync/${ruleName}`, \"error\"]),\n) as Record<`appsync/${Exclude<keyof typeof rules, \"no-appsync-globals\">}`, \"error\">;\n\nexport const portable = {\n ...recommended,\n \"appsync/no-appsync-globals\": \"error\",\n} as const;\n","import { plugin, portable, recommended } from \"./plugin.js\";\n\nexport { plugin, portable, recommended };\nexport default plugin;\n"],"mappings":";;AAAA,MAAa,uCAAuB,IAAI,IAAI;CAC1C;CACA;CACA;AACF,CAAC;;;ACAD,SAAgB,kBAAkB,MAA4C;CAC5E,OAAO;AACT;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