diff --git a/lib/cli-engine/formatters/html.js b/lib/cli-engine/formatters/html.js index 6e40bbe16b7..b6365997117 100644 --- a/lib/cli-engine/formatters/html.js +++ b/lib/cli-engine/formatters/html.js @@ -151,7 +151,7 @@ function pageTemplate(it) { -`.trimStart(); +`.trimLeft(); } /** @@ -222,7 +222,7 @@ function messageTemplate(it) { ${ruleId ? ruleId : ""} -`.trimStart(); +`.trimLeft(); } /** @@ -280,7 +280,7 @@ function resultTemplate(it) { ${encodeHTML(summary)} -`.trimStart(); +`.trimLeft(); } /** diff --git a/lib/linter/apply-disable-directives.js b/lib/linter/apply-disable-directives.js index 459c8591196..f8e4aeedb29 100644 --- a/lib/linter/apply-disable-directives.js +++ b/lib/linter/apply-disable-directives.js @@ -66,7 +66,7 @@ function createIndividualDirectivesRemoval(directives, commentToken) { const listText = commentToken.value .slice(listStartOffset) // remove directive name and all whitespace before the list .split(/\s-{2,}\s/u)[0] // remove `-- comment`, if it exists - .trimEnd(); // remove all whitespace after the list + .trimRight(); // remove all whitespace after the list /* * We can assume that `listText` contains multiple elements. diff --git a/messages/all-files-ignored.js b/messages/all-files-ignored.js index 70877a4d823..d85828d36e7 100644 --- a/messages/all-files-ignored.js +++ b/messages/all-files-ignored.js @@ -12,5 +12,5 @@ If you do want to lint these files, try the following solutions: * Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored. * Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument. -`.trimStart(); +`.trimLeft(); }; diff --git a/messages/extend-config-missing.js b/messages/extend-config-missing.js index 5b3498fcda4..db8a5c64b9f 100644 --- a/messages/extend-config-missing.js +++ b/messages/extend-config-missing.js @@ -9,5 +9,5 @@ ESLint couldn't find the config "${configName}" to extend from. Please check tha The config "${configName}" was referenced from the config file in "${importerName}". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. -`.trimStart(); +`.trimLeft(); }; diff --git a/messages/failed-to-read-json.js b/messages/failed-to-read-json.js index e7c6cb58759..5114de30980 100644 --- a/messages/failed-to-read-json.js +++ b/messages/failed-to-read-json.js @@ -7,5 +7,5 @@ module.exports = function(it) { Failed to read JSON file at ${path}: ${message} -`.trimStart(); +`.trimLeft(); }; diff --git a/messages/file-not-found.js b/messages/file-not-found.js index 1a62fcf96b9..26a5d57eff7 100644 --- a/messages/file-not-found.js +++ b/messages/file-not-found.js @@ -6,5 +6,5 @@ module.exports = function(it) { return ` No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found. Please check for typing mistakes in the pattern. -`.trimStart(); +`.trimLeft(); }; diff --git a/messages/no-config-found.js b/messages/no-config-found.js index 9860410a602..c2f7ac73b40 100644 --- a/messages/no-config-found.js +++ b/messages/no-config-found.js @@ -11,5 +11,5 @@ ESLint couldn't find a configuration file. To set up a configuration file for th ESLint looked for configuration files in ${directoryPath} and its ancestors. If it found none, it then looked in your home directory. If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://eslint.org/chat/help -`.trimStart(); +`.trimLeft(); }; diff --git a/messages/plugin-invalid.js b/messages/plugin-invalid.js index 8b471d4a336..7913576f000 100644 --- a/messages/plugin-invalid.js +++ b/messages/plugin-invalid.js @@ -12,5 +12,5 @@ module.exports = function(it) { "${configName}" was referenced from the config file in "${importerName}". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. -`.trimStart(); +`.trimLeft(); }; diff --git a/messages/plugin-missing.js b/messages/plugin-missing.js index 0b7d34e3aa5..f58c78ceb38 100644 --- a/messages/plugin-missing.js +++ b/messages/plugin-missing.js @@ -15,5 +15,5 @@ It's likely that the plugin isn't installed correctly. Try reinstalling by runni The plugin "${pluginName}" was referenced from the config file in "${importerName}". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. -`.trimStart(); +`.trimLeft(); }; diff --git a/messages/print-config-with-directory-path.js b/messages/print-config-with-directory-path.js index f65bdaaf770..6a5d571dd37 100644 --- a/messages/print-config-with-directory-path.js +++ b/messages/print-config-with-directory-path.js @@ -4,5 +4,5 @@ module.exports = function() { return ` The '--print-config' CLI option requires a path to a source code file rather than a directory. See also: https://eslint.org/docs/user-guide/command-line-interface#--print-config -`.trimStart(); +`.trimLeft(); }; diff --git a/messages/whitespace-found.js b/messages/whitespace-found.js index 8a801bcec6f..4ce49ca3a4e 100644 --- a/messages/whitespace-found.js +++ b/messages/whitespace-found.js @@ -7,5 +7,5 @@ module.exports = function(it) { ESLint couldn't find the plugin "${pluginName}". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name. If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. -`.trimStart(); +`.trimLeft(); };