lib/util/report-translator.js
function normalizeFixes(descriptor, sourceCode) {
    if (typeof descriptor.fix !== "function") {
        return null;
    }

    // @type {null | Fix | Fix[] | IterableIterator<Fix>}
    const fix = descriptor.fix(ruleFixer);

    // Merge to one.
    if (fix && Symbol.iterator in fix) {
        return mergeFixes(Array.from(fix), sourceCode);
    }
    return fix;
}
function normalizeFixes(descriptor, sourceCode) {
    if (typeof descriptor.fix !== "function") {
        return null;
    }

    // @type {null | Fix | Fix[] | IterableIterator<Fix>}
    const fix = descriptor.fix(ruleFixer);

    // Merge to one.
    if (fix && Symbol.iterator in fix) {
        return mergeFixes(Array.from(fix), sourceCode);
    }
    return fix;
}
function normalizeFixes ( descriptor , sourceCode ) { if ( typeof descriptor . fix !== "function" ) { return null ; } // @type {null | Fix | Fix[] | IterableIterator<Fix>} const fix = descriptor . fix ( ruleFixer ) ; // Merge to one. if ( fix && Symbol . iterator in fix ) { return mergeFixes ( Array . from ( fix ) , sourceCode ) ; } return fix ; }
Gets one fix object from the given descriptor.
If the descriptor retrieves multiple fixes, this merges those to one.
@param {MessageDescriptor} descriptor The report descriptor.
@param {SourceCode} sourceCode The source code object to get text between fixes.
@returns {({text: string, range: number[]}|null)} The fix for the descriptor
Gets one fix object from the given descriptor . If the descriptor retrieves multiple fixes this merges those to one .