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

Code before:
                inlineConfigProblems.push(
                    ...inlineConfigResult.problems
                        .map(createLintingProblem)
                        .map(problem => {
                            problem.fatal = true;
                            return problem;
                        })
                );

                // next we need to verify information about the specified rules
                const ruleValidator = new RuleValidator();

                for (const { config: inlineConfig, node } of inlineConfigResult.configs) {

                    Object.keys(inlineConfig.rules).forEach(ruleId => {
                        const rule = getRuleFromConfig(ruleId, config);
                        const ruleValue = inlineConfig.rules[ruleId];

                        if (!rule) {
                            inlineConfigProblems.push(createLintingProblem({ ruleId, loc: node.loc }));
                            return;
                        }

                        if (Object.hasOwn(mergedInlineConfig.rules, ruleId)) {
                            inlineConfigProblems.push(createLintingProblem({
                                message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code.`,
                                loc: node.loc
                            }));
                            return;
                        }

                        try {

                            let ruleOptions = Array.isArray(ruleValue) ? ruleValue : [ruleValue];

                            assertIsRuleSeverity(ruleId, ruleOptions[0]);

                            /*
                             * If the rule was already configured, inline rule configuration that
                             * only has severity should retain options from the config and just override the severity.
                             *
                             * Example:
                             *
                             *   {
                             *       rules: {
                             *           curly: ["error", "multi"]
                             *       }
                             *   }
                             *
                             *   /* eslint curly: ["warn"] * /
                             *

Review comment (suggestion):
```suggestion
                                message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`,
```

Code after:
                inlineConfigProblems.push(
                    ...inlineConfigResult.problems
                        .map(createLintingProblem)
                        .map(problem => {
                            problem.fatal = true;
                            return problem;
                        })
                );

                // next we need to verify information about the specified rules
                const ruleValidator = new RuleValidator();

                for (const { config: inlineConfig, node } of inlineConfigResult.configs) {

                    Object.keys(inlineConfig.rules).forEach(ruleId => {
                        const rule = getRuleFromConfig(ruleId, config);
                        const ruleValue = inlineConfig.rules[ruleId];

                        if (!rule) {
                            inlineConfigProblems.push(createLintingProblem({ ruleId, loc: node.loc }));
                            return;
                        }

                        if (Object.hasOwn(mergedInlineConfig.rules, ruleId)) {
                            inlineConfigProblems.push(createLintingProblem({
                                message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`,
                                loc: node.loc
                            }));
                            return;
                        }

                        try {

                            let ruleOptions = Array.isArray(ruleValue) ? ruleValue : [ruleValue];

                            assertIsRuleSeverity(ruleId, ruleOptions[0]);

                            /*
                             * If the rule was already configured, inline rule configuration that
                             * only has severity should retain options from the config and just override the severity.
                             *
                             * Example:
                             *
                             *   {
                             *       rules: {
                             *           curly: ["error", "multi"]
                             *       }
                             *   }
                             *
                             *   /* eslint curly: ["warn"] * /
                             *