Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace trimLeft/trimRight with trimStart/trimEnd #15750

Merged
merged 1 commit into from Apr 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/cli-engine/formatters/html.js
Expand Up @@ -151,7 +151,7 @@ function pageTemplate(it) {
</script>
</body>
</html>
`.trimLeft();
`.trimStart();
}

/**
Expand Down Expand Up @@ -222,7 +222,7 @@ function messageTemplate(it) {
<a href="${ruleUrl ? ruleUrl : ""}" target="_blank" rel="noopener noreferrer">${ruleId ? ruleId : ""}</a>
</td>
</tr>
`.trimLeft();
`.trimStart();
}

/**
Expand Down Expand Up @@ -280,7 +280,7 @@ function resultTemplate(it) {
<span>${encodeHTML(summary)}</span>
</th>
</tr>
`.trimLeft();
`.trimStart();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/linter/apply-disable-directives.js
Expand Up @@ -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
.trimRight(); // remove all whitespace after the list
.trimEnd(); // remove all whitespace after the list

/*
* We can assume that `listText` contains multiple elements.
Expand Down
2 changes: 1 addition & 1 deletion messages/all-files-ignored.js
Expand Up @@ -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.
`.trimLeft();
`.trimStart();
};
2 changes: 1 addition & 1 deletion messages/extend-config-missing.js
Expand Up @@ -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.
`.trimLeft();
`.trimStart();
};
2 changes: 1 addition & 1 deletion messages/failed-to-read-json.js
Expand Up @@ -7,5 +7,5 @@ module.exports = function(it) {
Failed to read JSON file at ${path}:

${message}
`.trimLeft();
`.trimStart();
};
2 changes: 1 addition & 1 deletion messages/file-not-found.js
Expand Up @@ -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.
`.trimLeft();
`.trimStart();
};
2 changes: 1 addition & 1 deletion messages/no-config-found.js
Expand Up @@ -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
`.trimLeft();
`.trimStart();
};
2 changes: 1 addition & 1 deletion messages/plugin-invalid.js
Expand Up @@ -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.
`.trimLeft();
`.trimStart();
};
2 changes: 1 addition & 1 deletion messages/plugin-missing.js
Expand Up @@ -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.
`.trimLeft();
`.trimStart();
};
2 changes: 1 addition & 1 deletion messages/print-config-with-directory-path.js
Expand Up @@ -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
`.trimLeft();
`.trimStart();
};
2 changes: 1 addition & 1 deletion messages/whitespace-found.js
Expand Up @@ -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.
`.trimLeft();
`.trimStart();
};