Skip to content
Permalink
Browse files
refactor: remove unused parameter in linter.js (#15451)
  • Loading branch information
mdjermanovic committed Dec 25, 2021
1 parent eaa08d3 commit 28e907a4ca05a026d156f814f4118f8fe713e99d
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/linter/linter.js
@@ -326,14 +326,13 @@ function stripDirectiveComment(value) {
* 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 {string} filename The file being checked.
* @param {ASTNode} ast The top node of the AST.
* @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.
* @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: Problem[], disableDirectives: DisableDirective[]}}
* A collection of the directive comments that were found, along with any problems that occurred when parsing
*/
function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) {
function getDirectiveComments(ast, ruleMapper, warnInlineConfig) {
const configuredRules = {};
const enabledGlobals = Object.create(null);
const exportedVariables = {};
@@ -1332,7 +1331,7 @@ class Linter {

const sourceCode = slots.lastSourceCode;
const commentDirectives = options.allowInlineConfig
? getDirectiveComments(options.filename, sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig)
? getDirectiveComments(sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig)
: { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] };

// augment global scope with declared global variables
@@ -1593,7 +1592,6 @@ class Linter {
const sourceCode = slots.lastSourceCode;
const commentDirectives = options.allowInlineConfig
? getDirectiveComments(
options.filename,
sourceCode.ast,
ruleId => getRuleFromConfig(ruleId, config),
options.warnInlineConfig

0 comments on commit 28e907a

Please sign in to comment.