Skip to content

Commit

Permalink
refactor: remove Identifier listener in no-irregular-whitespace (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored Jun 2, 2023
1 parent a589636 commit 0892412
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/rules/no-irregular-whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ module.exports = {
}

/**
* Checks identifier or literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
* Checks literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
* @param {ASTNode} node to check for matching errors.
* @returns {void}
* @private
*/
function removeInvalidNodeErrorsInIdentifierOrLiteral(node) {
function removeInvalidNodeErrorsInLiteral(node) {
const shouldCheckStrings = skipStrings && (typeof node.value === "string");
const shouldCheckRegExps = skipRegExps && Boolean(node.regex);

Expand Down Expand Up @@ -237,8 +237,7 @@ module.exports = {
checkForIrregularLineTerminators(node);
};

nodes.Identifier = removeInvalidNodeErrorsInIdentifierOrLiteral;
nodes.Literal = removeInvalidNodeErrorsInIdentifierOrLiteral;
nodes.Literal = removeInvalidNodeErrorsInLiteral;
nodes.TemplateElement = skipTemplates ? removeInvalidNodeErrorsInTemplateLiteral : noop;
nodes["Program:exit"] = function() {
if (skipComments) {
Expand Down

0 comments on commit 0892412

Please sign in to comment.