From db41408d6cbfd684fa2d45550a7e9fafaaddfa83 Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Sat, 14 Oct 2017 14:21:21 -0400 Subject: [PATCH] Chore: avoid applying eslint-env comments twice (#9278) --- lib/linter.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/linter.js b/lib/linter.js index e96e713ffdb..089f0bb2503 100755 --- a/lib/linter.js +++ b/lib/linter.js @@ -291,7 +291,7 @@ function createDisableDirectives(type, loc, value) { */ function modifyConfigsFromComments(filename, ast, config, linterContext) { - let commentConfig = { + const commentConfig = { exported: {}, astGlobals: {}, rules: {}, @@ -320,10 +320,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; @@ -361,14 +357,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 {