Skip to content

Commit

Permalink
Fix: Ignore inline plugin rule config in autoconfig (fixes #7860)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Jan 14, 2017
1 parent 6448ba0 commit e8cff13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/config/autoconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,13 @@ class Registry {

// It is possible that the error is from a configuration comment
// in a linted file, in which case there may not be a config
// set in this ruleSetIdx. (https://github.com/eslint/eslint/issues/5992)
if (lintedRegistry.rules[result.ruleId][ruleSetIdx]) {
// set in this ruleSetIdx.
// (https://github.com/eslint/eslint/issues/5992)
// (https://github.com/eslint/eslint/issues/7860)
if (
lintedRegistry.rules[result.ruleId]
&& lintedRegistry.rules[result.ruleId][ruleSetIdx]
) {
lintedRegistry.rules[result.ruleId][ruleSetIdx].errorCount += 1;
}
});
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/autoconfig/source-with-comments.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint semi: [2, "never"] */
/* eslint import/extensions: 2 */

var foo = 42;
var baz = "baz";
Expand Down

0 comments on commit e8cff13

Please sign in to comment.