lib: enforce use of trailing commas for functions

PR-URL: https://github.com/nodejs/node/pull/46629
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
This commit is contained in:
Antoine du Hamel 2023-02-14 18:45:16 +01:00 committed by GitHub
parent 3acdeb1f7a
commit fe514bf960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 389 additions and 389 deletions

View file

@ -148,7 +148,7 @@ function fail(actual, expected, message, operator, stackStartFn) {
'assert.fail() with more than one argument is deprecated. ' +
'Please use assert.strictEqual() instead or only pass a message.',
'DeprecationWarning',
'DEP0094'
'DEP0094',
);
}
if (argsLen === 2)
@ -807,13 +807,13 @@ function expectsError(stackStartFn, actual, error, message) {
if (actual.message === error) {
throw new ERR_AMBIGUOUS_ARGUMENT(
'error/message',
`The error message "${actual.message}" is identical to the message.`
`The error message "${actual.message}" is identical to the message.`,
);
}
} else if (actual === error) {
throw new ERR_AMBIGUOUS_ARGUMENT(
'error/message',
`The error "${actual}" is identical to the message.`
`The error "${actual}" is identical to the message.`,
);
}
message = error;
@ -855,7 +855,7 @@ function hasMatchingError(actual, expected) {
return RegExpPrototypeExec(expected, str) !== null;
}
throw new ERR_INVALID_ARG_TYPE(
'expected', ['Function', 'RegExp'], expected
'expected', ['Function', 'RegExp'], expected,
);
}
// Guard instanceof against arrow functions as they don't have a prototype.
@ -970,7 +970,7 @@ assert.ifError = function ifError(err) {
if (origStackStart !== -1) {
const originalFrames = StringPrototypeSplit(
StringPrototypeSlice(origStack, origStackStart + 1),
'\n'
'\n',
);
// Filter all frames existing in err.stack.
let newFrames = StringPrototypeSplit(newErr.stack, '\n');
@ -996,7 +996,7 @@ assert.ifError = function ifError(err) {
function internalMatch(string, regexp, message, fn) {
if (!isRegExp(regexp)) {
throw new ERR_INVALID_ARG_TYPE(
'regexp', 'RegExp', regexp
'regexp', 'RegExp', regexp,
);
}
const match = fn === assert.match;