Repository: eslint/eslint
File: lib/linter/linter.js (JavaScript)

Code before:

        // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/)
        if (ruleId === null || !!ruleMapper(ruleId)) {
            if (type === "disable-next-line") {
                const { line, column } = updateLocationInformation(
                    {
                        line: node.loc.end.line,
                        column: node.loc.end.column
                    },
                    language
                );

                result.directives.push({
                    parentDirective,
                    type,
                    line,
                    column,
                    ruleId,
                    justification
                });
            } else {
                const { line, column } = updateLocationInformation(
                    {
                        line: node.loc.start.line,
                        column: node.loc.start.column
                    },
                    language
                );

                result.directives.push({
                    parentDirective,
                    type,
                    line,
                    column,
                    ruleId,
                    justification
                });
            }
        } else {
            result.directiveProblems.push(createLintingProblem({ ruleId, loc: node.loc, language }));
        }
    }
    return result;
}

/**
 * Parses comments in file to extract file-specific config of rules, globals
 * and environments and merges them with global config; also code blocks
 * where reporting is disabled or enabled and merges them with reporting config.
 * @param {SourceCode} sourceCode The SourceCode object to get comments from.
 * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules

Review comment (suggestion):
Same
```suggestion
                const { line, column } = updateLocationInformation(
                    node.loc.start,
```

Code after:

        // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/)
        if (ruleId === null || !!ruleMapper(ruleId)) {
            if (type === "disable-next-line") {
                const { line, column } = updateLocationInformation(
                    node.loc.end,
                    language
                );

                result.directives.push({
                    parentDirective,
                    type,
                    line,
                    column,
                    ruleId,
                    justification
                });
            } else {
                const { line, column } = updateLocationInformation(
                    node.loc.start,
                    language
                );

                result.directives.push({
                    parentDirective,
                    type,
                    line,
                    column,
                    ruleId,
                    justification
                });
            }
        } else {
            result.directiveProblems.push(createLintingProblem({ ruleId, loc: node.loc, language }));
        }
    }
    return result;
}

/**
 * Parses comments in file to extract file-specific config of rules, globals
 * and environments and merges them with global config; also code blocks
 * where reporting is disabled or enabled and merges them with reporting config.
 * @param {SourceCode} sourceCode The SourceCode object to get comments from.
 * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
 * @param {string|null} warnInlineConfig If a string then it should warn directive comments as disabled. The string value is the config name what the setting came from.
 * @param {ConfigData} config Provided config.
 * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: LintMessage[], disableDirectives: DisableDirective[]}}
 * A collection of the directive comments that were found, along with any problems that occurred when parsing
 */
function getDirectiveComments(sourceCode, ruleMapper, warnInlineConfig, config) {