@interlace/eslint-devkit 2.0.1 → 2.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interlace/eslint-devkit",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Toolkit for building ESLint plugins in TypeScript — AST helpers, type utilities, rule-creation scaffolding, security benchmarks, and SARIF output.",
5
5
  "type": "commonjs",
6
6
  "sideEffects": false,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.propertyKeyName=propertyKeyName;exports.hasTruthyKey=hasTruthyKey;exports.hasArgumentScope=hasArgumentScope;exports.chainMethodNames=chainMethodNames;exports.driverBindings=driverBindings;exports.receiverBaseName=receiverBaseName;exports.createUnscopedMutationRule=createUnscopedMutationRule;exports.startsWithTable=startsWithTable;exports.insideAny=insideAny;exports.exportedFunctions=exportedFunctions;exports.scopedElsewhere=scopedElsewhere;const rule_creator_1=require("./rule-creator");const ast_node_types_1=require("../ast-node-types");const spellings_1=require("../ast/spellings");const messaging_1=require("../messaging");const module_evidence_1=require("./module-evidence");const rule_creator_2=require("./rule-creator");const driver_origin_1=require("./driver-origin");const value_follow_1=require("./value-follow");const DEFAULT_SCOPE_KEYS=["where"];const DEFAULT_SCOPE_METHODS=["where"];function propertyKeyName(prop){if(prop.type!==ast_node_types_1.AST_NODE_TYPES.Property)return void 0;if(prop.computed)return void 0;if(prop.key.type===ast_node_types_1.AST_NODE_TYPES.Identifier)return prop.key.name;if(prop.key.type===ast_node_types_1.AST_NODE_TYPES.Literal&&typeof prop.key.value==="string"){return prop.key.value}return void 0}function hasTruthyKey(obj,keys){return obj.properties.some(prop=>{if(prop.type!==ast_node_types_1.AST_NODE_TYPES.Property)return false;const name=propertyKeyName(prop);if(name===void 0||!keys.includes(name))return false;return!(prop.value.type===ast_node_types_1.AST_NODE_TYPES.Literal&&!prop.value.value)})}function hasArgumentScope(args,scopeKeys){return args.some(arg=>{if(arg.type===ast_node_types_1.AST_NODE_TYPES.ObjectExpression){return arg.properties.some(prop=>{if(prop.type===ast_node_types_1.AST_NODE_TYPES.SpreadElement)return true;const name=propertyKeyName(prop);if(name===void 0)return true;if(!scopeKeys.includes(name))return false;if(prop.type===ast_node_types_1.AST_NODE_TYPES.Property&&prop.value.type===ast_node_types_1.AST_NODE_TYPES.ObjectExpression&&prop.value.properties.length===0){return false}return true})}return arg.type!==ast_node_types_1.AST_NODE_TYPES.Literal})}function chainMethodNames(node){let root=node;for(;;){const parent=root.parent;if(!parent)break;if(parent.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression&&parent.object===root){root=parent;continue}if(parent.type===ast_node_types_1.AST_NODE_TYPES.CallExpression&&parent.callee===root){root=parent;continue}break}const names=new Set;let cursor=root;for(;;){if(cursor.type===ast_node_types_1.AST_NODE_TYPES.CallExpression){cursor=cursor.callee;continue}if(cursor.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression){const name=(0,spellings_1.propertyName)(cursor);if(name!==null)names.add(name);cursor=cursor.object;continue}break}return names}function driverBindings(program,modules){const names=new Set;const isDriver=source=>modules.some(m=>source===m||source.startsWith(`${m}/`));for(const stmt of program.body){if(stmt.type===ast_node_types_1.AST_NODE_TYPES.ImportDeclaration){if(typeof stmt.source.value!=="string"||!isDriver(stmt.source.value))continue;for(const spec of stmt.specifiers)names.add(spec.local.name);continue}if(stmt.type!==ast_node_types_1.AST_NODE_TYPES.VariableDeclaration)continue;for(const decl of stmt.declarations){const init=decl.init;if(!init||init.type!==ast_node_types_1.AST_NODE_TYPES.CallExpression||init.callee.type!==ast_node_types_1.AST_NODE_TYPES.Identifier||init.callee.name!=="require"){continue}const arg=init.arguments[0];if(!arg||arg.type!==ast_node_types_1.AST_NODE_TYPES.Literal||typeof arg.value!=="string"||!isDriver(arg.value)){continue}if(decl.id.type===ast_node_types_1.AST_NODE_TYPES.Identifier)names.add(decl.id.name);if(decl.id.type===ast_node_types_1.AST_NODE_TYPES.ObjectPattern){for(const prop of decl.id.properties){if(prop.type===ast_node_types_1.AST_NODE_TYPES.Property&&prop.value.type===ast_node_types_1.AST_NODE_TYPES.Identifier){names.add(prop.value.name)}}}}}return names}function receiverBaseName(node){let cursor=node.object;for(;;){if(cursor.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression){if(cursor.object.type===ast_node_types_1.AST_NODE_TYPES.ThisExpression&&!cursor.computed&&cursor.property.type===ast_node_types_1.AST_NODE_TYPES.Identifier){return cursor.property.name}cursor=cursor.object;continue}if(cursor.type===ast_node_types_1.AST_NODE_TYPES.CallExpression){cursor=cursor.callee;continue}return cursor.type===ast_node_types_1.AST_NODE_TYPES.Identifier?cursor.name:void 0}}function createUnscopedMutationRule(config){const sinks=new Set(config.methods);const scopeKeys=config.scopeKeys??DEFAULT_SCOPE_KEYS;const scopeMethods=config.scopeMethods??DEFAULT_SCOPE_METHODS;const truncateKeys=config.truncateKeys??[];const argumentRole=config.argumentRole??"options";const usesModule=(0,module_evidence_1.createModuleEvidence)({packages:config.modules});const originOf=(0,driver_origin_1.createOriginClassifier)(config.modules);return rule_creator_1.RuleCreator.withoutDocs({meta:{interop:{runtimes:["eslint","oxlint"]},type:config.meta.type,docs:{...config.meta.docs},messages:{unscopedMutation:(0,messaging_1.formatLLMMessage)({icon:messaging_1.MessageIcons.SECURITY,issueName:"Unscoped Bulk Mutation",description:"Bulk mutation with no filter detected. This rewrites or deletes every row in the table.",severity:"HIGH",cwe:config.meta.docs.cwe,owasp:"A01:2021",compliance:["SOC2","NIST-CSF"],effort:"low",fix:config.fix,documentationLink:config.documentationLink}),explicitTruncate:(0,messaging_1.formatLLMMessage)({icon:messaging_1.MessageIcons.SECURITY,issueName:"Unscoped Bulk Mutation",description:"Table truncation detected. This ignores any filter and empties the whole table.",severity:"HIGH",cwe:config.meta.docs.cwe,owasp:"A01:2021",compliance:["SOC2","NIST-CSF"],effort:"low",fix:"Remove the truncate flag and delete by filter, or move the truncation to an explicit maintenance script.",documentationLink:config.documentationLink})},schema:[]},defaultOptions:[],createOnce(context){let env;let ownsFile;let migrations;function hasDistinctiveShape(node){const callee=node.callee;switch(config.distinctiveShape){case"model-accessor":return callee.object.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression;case"table-call":return startsWithTable(callee.object);case"table-argument":{const[table]=node.arguments;return table!==void 0&&table.type!==ast_node_types_1.AST_NODE_TYPES.SpreadElement&&originOf((0,value_follow_1.valueAt)(table,env))==="ours"}default:return false}}return{before(){if((0,rule_creator_2.isTestFilePath)(context.filename))return false;env=(0,value_follow_1.envOf)(context);ownsFile=false;migrations=new Set;return true},Program(program){ownsFile=usesModule(program);migrations=exportedFunctions(program,config.migrationExports??[],context)},CallExpression(node){if(node.callee.type!==ast_node_types_1.AST_NODE_TYPES.MemberExpression||!sinks.has((0,spellings_1.propertyName)(node.callee)??"")){return}const origin=originOf((0,value_follow_1.valueAt)(node.callee.object,env));if(origin==="foreign")return;if(origin==="unknown"&&!(ownsFile&&hasDistinctiveShape(node))){return}if(insideAny(node,migrations))return;if(truncateKeys.length>0){const truncating=node.arguments.some(arg=>arg.type===ast_node_types_1.AST_NODE_TYPES.ObjectExpression&&hasTruthyKey(arg,truncateKeys));if(truncating){context.report({node,messageId:"explicitTruncate"});return}}if(argumentRole==="options"){if(config.requireOptionsObject===true&&!node.arguments.some(arg=>arg.type===ast_node_types_1.AST_NODE_TYPES.ObjectExpression)){return}if(hasArgumentScope(node.arguments,scopeKeys))return}const chained=chainMethodNames(node);if(scopeMethods.some(name=>chained.has(name)))return;if(scopedElsewhere(node,scopeMethods,env))return;context.report({node,messageId:"unscopedMutation"})}}}})}const TABLE_STARTERS=new Set(["table","from","into","queryBuilder","withSchema"]);function startsWithTable(receiver){let cursor=receiver;for(;;){if(cursor.type===ast_node_types_1.AST_NODE_TYPES.CallExpression){if(cursor.callee.type!==ast_node_types_1.AST_NODE_TYPES.MemberExpression)return true;if(TABLE_STARTERS.has((0,spellings_1.propertyName)(cursor.callee)??""))return true;cursor=cursor.callee.object;continue}if(cursor.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression){cursor=cursor.object;continue}return false}}function insideAny(node,functions){for(let n=node.parent;n;n=n.parent){if(functions.has(n))return true}return false}function exportedFunctions(program,names,context){const found=new Set;const scopeManager=context.sourceCode.scopeManager;if(names.length===0||scopeManager===null)return found;const module={file:context.physicalFilename,ast:program,scopeManager};for(const name of names){const exported=(0,value_follow_1.exportedValue)(module,name,context.languageOptions?.parser);if(exported===null)continue;const target=(0,value_follow_1.follow)(exported);if((0,driver_origin_1.isFunctionNode)(target.node))found.add(target.node)}return found}function heldThenScoped(node,scopeMethods,env){let top=node;while(top.parent?.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression&&top.parent.object===top||top.parent?.type===ast_node_types_1.AST_NODE_TYPES.CallExpression&&top.parent.callee===top){top=top.parent}const declarator=top.parent;if(declarator?.type!==ast_node_types_1.AST_NODE_TYPES.VariableDeclarator||declarator.id.type!==ast_node_types_1.AST_NODE_TYPES.Identifier){return false}const variable=(0,value_follow_1.lookup)(declarator.id.name,env.scopeOf(declarator.id));return variable.references.some(reference=>{const use=reference.identifier.parent;if(use.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression)return scopeMethods.includes((0,spellings_1.propertyName)(use));return(use.type===ast_node_types_1.AST_NODE_TYPES.CallExpression||use.type===ast_node_types_1.AST_NODE_TYPES.NewExpression)&&use.arguments.some(argument=>argument===reference.identifier)})}function scopedElsewhere(node,scopeMethods,env){let root=node.callee;while(root.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression||root.type===ast_node_types_1.AST_NODE_TYPES.CallExpression){root=root.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression?root.object:root.callee}if(heldThenScoped(node,scopeMethods,env))return true;if(root.type!==ast_node_types_1.AST_NODE_TYPES.Identifier)return false;const variable=(0,value_follow_1.lookup)(root.name,env.scopeOf(root));if(variable===null||variable.defs[0]?.type!=="Variable")return false;return variable.references.some(reference=>{const use=reference.identifier.parent;if(use?.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression&&use.object===reference.identifier){return scopeMethods.includes((0,spellings_1.propertyName)(use)??"")}return(use?.type===ast_node_types_1.AST_NODE_TYPES.CallExpression||use?.type===ast_node_types_1.AST_NODE_TYPES.NewExpression)&&use.arguments.some(argument=>argument===reference.identifier)})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.propertyKeyName=propertyKeyName;exports.hasTruthyKey=hasTruthyKey;exports.hasArgumentScope=hasArgumentScope;exports.chainMethodNames=chainMethodNames;exports.driverBindings=driverBindings;exports.receiverBaseName=receiverBaseName;exports.createUnscopedMutationRule=createUnscopedMutationRule;exports.startsWithTable=startsWithTable;exports.insideAny=insideAny;exports.exportedFunctions=exportedFunctions;exports.scopedElsewhere=scopedElsewhere;const rule_creator_1=require("./rule-creator");const ast_node_types_1=require("../ast-node-types");const spellings_1=require("../ast/spellings");const messaging_1=require("../messaging");const module_evidence_1=require("./module-evidence");const rule_creator_2=require("./rule-creator");const driver_origin_1=require("./driver-origin");const value_follow_1=require("./value-follow");const DEFAULT_SCOPE_KEYS=["where"];const DEFAULT_SCOPE_METHODS=["where"];function propertyKeyName(prop){if(prop.type!==ast_node_types_1.AST_NODE_TYPES.Property)return void 0;if(prop.computed)return void 0;if(prop.key.type===ast_node_types_1.AST_NODE_TYPES.Identifier)return prop.key.name;if(prop.key.type===ast_node_types_1.AST_NODE_TYPES.Literal&&typeof prop.key.value==="string"){return prop.key.value}return void 0}function hasTruthyKey(obj,keys){return obj.properties.some(prop=>{if(prop.type!==ast_node_types_1.AST_NODE_TYPES.Property)return false;const name=propertyKeyName(prop);if(name===void 0||!keys.includes(name))return false;return!(prop.value.type===ast_node_types_1.AST_NODE_TYPES.Literal&&!prop.value.value)})}function hasArgumentScope(args,scopeKeys){return args.some(arg=>{if(arg.type===ast_node_types_1.AST_NODE_TYPES.ObjectExpression){return arg.properties.some(prop=>{if(prop.type===ast_node_types_1.AST_NODE_TYPES.SpreadElement)return true;const name=propertyKeyName(prop);if(name===void 0)return true;if(!scopeKeys.includes(name))return false;if(prop.type===ast_node_types_1.AST_NODE_TYPES.Property&&prop.value.type===ast_node_types_1.AST_NODE_TYPES.ObjectExpression&&prop.value.properties.length===0){return false}return true})}return arg.type!==ast_node_types_1.AST_NODE_TYPES.Literal})}function chainMethodNames(node){let root=node;for(;;){const parent=root.parent;if(!parent)break;if(parent.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression&&parent.object===root){root=parent;continue}if(parent.type===ast_node_types_1.AST_NODE_TYPES.CallExpression&&parent.callee===root){root=parent;continue}break}const names=new Set;let cursor=root;for(;;){if(cursor.type===ast_node_types_1.AST_NODE_TYPES.CallExpression){cursor=cursor.callee;continue}if(cursor.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression){const name=(0,spellings_1.propertyName)(cursor);if(name!==null)names.add(name);cursor=cursor.object;continue}break}return names}function driverBindings(program,modules){const names=new Set;const isDriver=source=>modules.some(m=>source===m||source.startsWith(`${m}/`));for(const stmt of program.body){if(stmt.type===ast_node_types_1.AST_NODE_TYPES.ImportDeclaration){if(typeof stmt.source.value!=="string"||!isDriver(stmt.source.value))continue;for(const spec of stmt.specifiers)names.add(spec.local.name);continue}if(stmt.type!==ast_node_types_1.AST_NODE_TYPES.VariableDeclaration)continue;for(const decl of stmt.declarations){const init=decl.init;if(!init||init.type!==ast_node_types_1.AST_NODE_TYPES.CallExpression||init.callee.type!==ast_node_types_1.AST_NODE_TYPES.Identifier||init.callee.name!=="require"){continue}const arg=init.arguments[0];if(!arg||arg.type!==ast_node_types_1.AST_NODE_TYPES.Literal||typeof arg.value!=="string"||!isDriver(arg.value)){continue}if(decl.id.type===ast_node_types_1.AST_NODE_TYPES.Identifier)names.add(decl.id.name);if(decl.id.type===ast_node_types_1.AST_NODE_TYPES.ObjectPattern){for(const prop of decl.id.properties){if(prop.type===ast_node_types_1.AST_NODE_TYPES.Property&&prop.value.type===ast_node_types_1.AST_NODE_TYPES.Identifier){names.add(prop.value.name)}}}}}return names}function receiverBaseName(node){let cursor=node.object;for(;;){if(cursor.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression){if(cursor.object.type===ast_node_types_1.AST_NODE_TYPES.ThisExpression&&!cursor.computed&&cursor.property.type===ast_node_types_1.AST_NODE_TYPES.Identifier){return cursor.property.name}cursor=cursor.object;continue}if(cursor.type===ast_node_types_1.AST_NODE_TYPES.CallExpression){cursor=cursor.callee;continue}return cursor.type===ast_node_types_1.AST_NODE_TYPES.Identifier?cursor.name:void 0}}function createUnscopedMutationRule(config){const sinks=new Set(config.methods);const scopeKeys=config.scopeKeys??DEFAULT_SCOPE_KEYS;const scopeMethods=config.scopeMethods??DEFAULT_SCOPE_METHODS;const truncateKeys=config.truncateKeys??[];const argumentRole=config.argumentRole??"options";const usesModule=(0,module_evidence_1.createModuleEvidence)({packages:config.modules});const originOf=(0,driver_origin_1.createOriginClassifier)(config.modules);return rule_creator_1.RuleCreator.withoutDocs({meta:{interop:{runtimes:["eslint","oxlint"]},type:config.meta.type,docs:{...config.meta.docs},messages:{unscopedMutation:(0,messaging_1.formatLLMMessage)({icon:messaging_1.MessageIcons.SECURITY,issueName:"Unscoped Bulk Mutation",description:"Bulk mutation with no filter detected. This rewrites or deletes every row in the table.",severity:"HIGH",cwe:config.meta.docs.cwe,owasp:"A01:2021",compliance:["SOC2","NIST-CSF"],effort:"low",fix:config.fix,documentationLink:config.documentationLink}),explicitTruncate:(0,messaging_1.formatLLMMessage)({icon:messaging_1.MessageIcons.SECURITY,issueName:"Unscoped Bulk Mutation",description:"Table truncation detected. This ignores any filter and empties the whole table.",severity:"HIGH",cwe:config.meta.docs.cwe,owasp:"A01:2021",compliance:["SOC2","NIST-CSF"],effort:"low",fix:"Remove the truncate flag and delete by filter, or move the truncation to an explicit maintenance script.",documentationLink:config.documentationLink})},schema:[]},defaultOptions:[],createOnce(context){let env;let ownsFile;let migrations;function hasDistinctiveShape(node){const callee=node.callee;switch(config.distinctiveShape){case"model-accessor":return callee.object.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression;case"table-call":return startsWithTable(callee.object);case"table-argument":{const[table]=node.arguments;return table!==void 0&&table.type!==ast_node_types_1.AST_NODE_TYPES.SpreadElement&&originOf((0,value_follow_1.valueAt)(table,env))==="ours"}default:return false}}return{before(){if((0,rule_creator_2.isTestFilePath)(context.filename))return false;env=(0,value_follow_1.envOf)(context);ownsFile=false;migrations=new Set;return true},Program(program){ownsFile=usesModule(program);migrations=exportedFunctions(program,config.migrationExports??[],context)},CallExpression(node){if(node.callee.type!==ast_node_types_1.AST_NODE_TYPES.MemberExpression||!sinks.has((0,spellings_1.propertyName)(node.callee)??"")){return}const origin=originOf((0,value_follow_1.valueAt)(node.callee.object,env));if(origin==="foreign")return;if(origin==="unknown"&&!(ownsFile&&hasDistinctiveShape(node))){return}if(insideAny(node,migrations))return;if(truncateKeys.length>0){const truncating=node.arguments.some(arg=>arg.type===ast_node_types_1.AST_NODE_TYPES.ObjectExpression&&hasTruthyKey(arg,truncateKeys));if(truncating){context.report({node,messageId:"explicitTruncate"});return}}if(argumentRole==="options"){if(config.requireOptionsObject===true&&!node.arguments.some(arg=>arg.type===ast_node_types_1.AST_NODE_TYPES.ObjectExpression)){return}if(hasArgumentScope(node.arguments,scopeKeys))return}const chained=chainMethodNames(node);if(scopeMethods.some(name=>chained.has(name)))return;if(scopedElsewhere(node,scopeMethods,env))return;context.report({node,messageId:"unscopedMutation"})}}}})}const TABLE_STARTERS=new Set(["table","from","into","queryBuilder","withSchema"]);function startsWithTable(receiver){let cursor=receiver;for(;;){if(cursor.type===ast_node_types_1.AST_NODE_TYPES.CallExpression){if(cursor.callee.type!==ast_node_types_1.AST_NODE_TYPES.MemberExpression)return true;if(TABLE_STARTERS.has((0,spellings_1.propertyName)(cursor.callee)??""))return true;cursor=cursor.callee.object;continue}if(cursor.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression){cursor=cursor.object;continue}return false}}function insideAny(node,functions){for(let n=node.parent;n;n=n.parent){if(functions.has(n))return true}return false}function exportedFunctions(program,names,context){const found=new Set;const scopeManager=context.sourceCode.scopeManager;if(names.length===0||scopeManager===null)return found;const module={file:context.physicalFilename,ast:program,scopeManager};for(const name of names){const exported=(0,value_follow_1.exportedValue)(module,name,context.languageOptions?.parser);if(exported===null)continue;const target=(0,value_follow_1.follow)(exported);if((0,driver_origin_1.isFunctionNode)(target.node))found.add(target.node)}return found}function heldThenScoped(node,scopeMethods,env){let top=node;while(top.parent?.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression&&top.parent.object===top||top.parent?.type===ast_node_types_1.AST_NODE_TYPES.CallExpression&&top.parent.callee===top){top=top.parent}const declarator=top.parent;if(declarator?.type!==ast_node_types_1.AST_NODE_TYPES.VariableDeclarator||declarator.id.type!==ast_node_types_1.AST_NODE_TYPES.Identifier){return false}const variable=(0,value_follow_1.lookup)(declarator.id.name,env.scopeOf(declarator.id));return variable.references.some(reference=>{const use=reference.identifier.parent;if(use.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression)return(0,spellings_1.namesOneOf)((0,spellings_1.propertyName)(use),scopeMethods);return(use.type===ast_node_types_1.AST_NODE_TYPES.CallExpression||use.type===ast_node_types_1.AST_NODE_TYPES.NewExpression)&&use.arguments.some(argument=>argument===reference.identifier)})}function scopedElsewhere(node,scopeMethods,env){let root=node.callee;while(root.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression||root.type===ast_node_types_1.AST_NODE_TYPES.CallExpression){root=root.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression?root.object:root.callee}if(heldThenScoped(node,scopeMethods,env))return true;if(root.type!==ast_node_types_1.AST_NODE_TYPES.Identifier)return false;const variable=(0,value_follow_1.lookup)(root.name,env.scopeOf(root));if(variable===null||variable.defs[0]?.type!=="Variable")return false;return variable.references.some(reference=>{const use=reference.identifier.parent;if(use?.type===ast_node_types_1.AST_NODE_TYPES.MemberExpression&&use.object===reference.identifier){return scopeMethods.includes((0,spellings_1.propertyName)(use)??"")}return(use?.type===ast_node_types_1.AST_NODE_TYPES.CallExpression||use?.type===ast_node_types_1.AST_NODE_TYPES.NewExpression)&&use.arguments.some(argument=>argument===reference.identifier)})}