Skip to content

Commit 0892412

Browse files
authored
refactor: remove Identifier listener in no-irregular-whitespace (#17235)
1 parent a589636 commit 0892412

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/rules/no-irregular-whitespace.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ module.exports = {
100100
}
101101

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

@@ -237,8 +237,7 @@ module.exports = {
237237
checkForIrregularLineTerminators(node);
238238
};
239239

240-
nodes.Identifier = removeInvalidNodeErrorsInIdentifierOrLiteral;
241-
nodes.Literal = removeInvalidNodeErrorsInIdentifierOrLiteral;
240+
nodes.Literal = removeInvalidNodeErrorsInLiteral;
242241
nodes.TemplateElement = skipTemplates ? removeInvalidNodeErrorsInTemplateLiteral : noop;
243242
nodes["Program:exit"] = function() {
244243
if (skipComments) {

0 commit comments

Comments
 (0)