UNPKG

eslint-plugin-sonarjs

Version:
23 lines (22 loc) • 989 B
import type estree from 'estree'; /** * Track direct loader factories and writes to their ambient API paths. * * `define([], function () {})` can be excluded without a nested function. * `sap.ui.define([], function () { function nested() {} })` can be excluded. * A write such as `sap.ui = other` keeps both functions checked. */ export declare class ModuleInitializerTracker { private readonly hasRuntimeBinding; private readonly scopeInitializers; private readonly writeTargets; constructor(hasRuntimeBinding: (node: estree.Node, name: string) => boolean); private invalidateWithWrite; private invalidateLoaderPath; private invalidateArrayPattern; private invalidateObjectPattern; recordCall(call: estree.CallExpression): void; recordWrite(target: estree.Node): void; /** Resolve the file-wide write guard after visiting the whole file. */ getExcludedFactories(hasNestedFunction: (node: estree.Node) => boolean): Set<estree.Node>; }