SonarJS linter helper functions
    Preparing search index...

    Function getFullyQualifiedName

    • Returns the fully qualified name of ESLint node

      This function filters out the node: prefix

      A fully qualified name here denotes a value that is accessed through an imported symbol, e.g., foo.bar.baz where foo was imported either from a require call or an import statement:

      const foo = require('lib');
      foo.bar.baz.qux; // matches the fully qualified name 'lib.bar.baz.qux' (not 'foo.bar.baz.qux')
      const foo2 = require('lib').bar;
      foo2.baz.qux; // matches the fully qualified name 'lib.bar.baz.qux'

      Returns null when an FQN could not be found.

      Parameters

      • context: RuleContext

        the rule context

      • node: Node

        the node

      • fqn: string[] = []

        the already traversed FQN (for recursive calls)

      • Optionalscope: Scope

        scope to look for the variable definition, used in recursion not to loop over same variable always in the lower scope

      Returns null | string