From ebeeab8a9eb528eae2ad949f143871967fab4ff7 Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Fri, 15 Sep 2017 15:16:30 -0400 Subject: [PATCH] Chore: avoid applying eslint-env comments twice --- lib/linter.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/linter.js b/lib/linter.js index b362a59ab9b..b02dd400602 100755 --- a/lib/linter.js +++ b/lib/linter.js @@ -290,7 +290,7 @@ function createDisableDirectives(type, loc, value) { */ function modifyConfigsFromComments(filename, ast, config, linterContext) { - let commentConfig = { + const commentConfig = { exported: {}, astGlobals: {}, rules: {}, @@ -319,10 +319,6 @@ function modifyConfigsFromComments(filename, ast, config, linterContext) { Object.assign(commentConfig.astGlobals, parseBooleanConfig(value, comment)); break; - case "eslint-env": - Object.assign(commentConfig.env, parseListConfig(value)); - break; - case "eslint-disable": [].push.apply(disableDirectives, createDisableDirectives("disable", comment.loc.start, value)); break; @@ -360,14 +356,6 @@ function modifyConfigsFromComments(filename, ast, config, linterContext) { } }); - // apply environment configs - Object.keys(commentConfig.env).forEach(name => { - const env = linterContext.environments.get(name); - - if (env) { - commentConfig = ConfigOps.merge(commentConfig, env); - } - }); Object.assign(commentConfig.rules, commentRules); return {