lib/utils/patch.js
function getCommentAt(message, sourceCode) {
    if (sourceCode != null) {
        const loc = { line: message.line, column: message.column - 1 }
        const index = sourceCode.getIndexFromLoc(loc)
        const options = { includeComments: true }
        const comment = sourceCode.getTokenByRangeStart(index, options)
        if (
            comment != null &&
            (comment.type === "Line" || comment.type === "Block")
        ) {
            return comment
        }
    }
    return undefined
}
function getCommentAt(message, sourceCode) {
    if (sourceCode != null) {
        const loc = { line: message.line, column: message.column - 1 }
        const index = sourceCode.getIndexFromLoc(loc)
        const options = { includeComments: true }
        const comment = sourceCode.getTokenByRangeStart(index, options)
        if (
            comment != null &&
            (comment.type === "Line" || comment.type === "Block")
        ) {
            return comment
        }
    }
    return undefined
}
function getCommentAt ( message , sourceCode ) { if ( sourceCode != null ) { const loc = { line : message . line , column : message . column - 1 } const index = sourceCode . getIndexFromLoc ( loc ) const options = { includeComments : true } const comment = sourceCode . getTokenByRangeStart ( index , options ) if ( comment != null && ( comment . type === "Line" || comment . type === "Block" ) ) { return comment } } return undefined }
Get the comment which is at a given message location.
@param {Message} message The message to get.
@param {SourceCode|undefined} sourceCode The source code object to get.
@returns {Comment|undefined} The gotten comment.
Get the comment which is at a given message location .