SonarJS linter helper functions
    Preparing search index...

    Function toEncodedMessage

    • Encodes an ESLint descriptor message with secondary locations

      The encoding consists in stringifying a JavaScript object with JSON.stringify that includes the ESLint's descriptor message along with second location information: message and location.

      This encoded message is eventually decoded by the linter wrapper on the condition that the rule definition of the flagged problem defines the internal sonar-runtime parameter in its schema.

      Parameters

      • reportDescriptor: ReportDescriptor

        the ESLint report descriptor

      • OptionalsecondaryLocations: IssueLocation[]

        the secondary locations

      • Optionalcost: number

        the optional cost to fix

      Returns ReportDescriptor

      the encoded message with secondary locations