Skip to content

Commit a59a4e6

Browse files
authored
chore: replace trimLeft/trimRight with trimStart/trimEnd (#15750)
1 parent fa9e4e3 commit a59a4e6

11 files changed

Lines changed: 13 additions & 13 deletions

lib/cli-engine/formatters/html.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function pageTemplate(it) {
151151
</script>
152152
</body>
153153
</html>
154-
`.trimLeft();
154+
`.trimStart();
155155
}
156156

157157
/**
@@ -222,7 +222,7 @@ function messageTemplate(it) {
222222
<a href="${ruleUrl ? ruleUrl : ""}" target="_blank" rel="noopener noreferrer">${ruleId ? ruleId : ""}</a>
223223
</td>
224224
</tr>
225-
`.trimLeft();
225+
`.trimStart();
226226
}
227227

228228
/**
@@ -280,7 +280,7 @@ function resultTemplate(it) {
280280
<span>${encodeHTML(summary)}</span>
281281
</th>
282282
</tr>
283-
`.trimLeft();
283+
`.trimStart();
284284
}
285285

286286
/**

lib/linter/apply-disable-directives.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function createIndividualDirectivesRemoval(directives, commentToken) {
6666
const listText = commentToken.value
6767
.slice(listStartOffset) // remove directive name and all whitespace before the list
6868
.split(/\s-{2,}\s/u)[0] // remove `-- comment`, if it exists
69-
.trimRight(); // remove all whitespace after the list
69+
.trimEnd(); // remove all whitespace after the list
7070

7171
/*
7272
* We can assume that `listText` contains multiple elements.

messages/all-files-ignored.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ If you do want to lint these files, try the following solutions:
1212
1313
* Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored.
1414
* 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.
15-
`.trimLeft();
15+
`.trimStart();
1616
};

messages/extend-config-missing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ ESLint couldn't find the config "${configName}" to extend from. Please check tha
99
The config "${configName}" was referenced from the config file in "${importerName}".
1010
1111
If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
12-
`.trimLeft();
12+
`.trimStart();
1313
};

messages/failed-to-read-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ module.exports = function(it) {
77
Failed to read JSON file at ${path}:
88
99
${message}
10-
`.trimLeft();
10+
`.trimStart();
1111
};

messages/file-not-found.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ module.exports = function(it) {
66
return `
77
No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found.
88
Please check for typing mistakes in the pattern.
9-
`.trimLeft();
9+
`.trimStart();
1010
};

messages/no-config-found.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ ESLint couldn't find a configuration file. To set up a configuration file for th
1111
ESLint looked for configuration files in ${directoryPath} and its ancestors. If it found none, it then looked in your home directory.
1212
1313
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
14-
`.trimLeft();
14+
`.trimStart();
1515
};

messages/plugin-invalid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ module.exports = function(it) {
1212
"${configName}" was referenced from the config file in "${importerName}".
1313
1414
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
15-
`.trimLeft();
15+
`.trimStart();
1616
};

messages/plugin-missing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ It's likely that the plugin isn't installed correctly. Try reinstalling by runni
1515
The plugin "${pluginName}" was referenced from the config file in "${importerName}".
1616
1717
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
18-
`.trimLeft();
18+
`.trimStart();
1919
};

messages/print-config-with-directory-path.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ module.exports = function() {
44
return `
55
The '--print-config' CLI option requires a path to a source code file rather than a directory.
66
See also: https://eslint.org/docs/user-guide/command-line-interface#--print-config
7-
`.trimLeft();
7+
`.trimStart();
88
};

0 commit comments

Comments
 (0)