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

@ -169,7 +169,7 @@ function InterfaceConstructor(input, output, completer, terminal) {
} else {
throw new ERR_INVALID_ARG_VALUE(
'input.escapeCodeTimeout',
this.escapeCodeTimeout
this.escapeCodeTimeout,
);
}
}
@ -625,7 +625,7 @@ class Interface extends InterfaceConstructor {
const end = StringPrototypeSlice(
this.line,
this.cursor,
this.line.length
this.line.length,
);
this.line = beg + c + end;
this.cursor += c.length;
@ -668,7 +668,7 @@ class Interface extends InterfaceConstructor {
// If there is a common prefix to all matches, then apply that portion.
const prefix = commonPrefix(
ArrayPrototypeFilter(completions, (e) => e !== '')
ArrayPrototypeFilter(completions, (e) => e !== ''),
);
if (StringPrototypeStartsWith(prefix, completeOn) &&
prefix.length > completeOn.length) {
@ -695,7 +695,7 @@ class Interface extends InterfaceConstructor {
// Apply/show completions.
const completionsWidth = ArrayPrototypeMap(completions, (e) =>
getStringWidth(e)
getStringWidth(e),
);
const width = MathMaxApply(completionsWidth) + 2; // 2 space padding
let maxColumns = MathFloor(this.columns / width) || 1;
@ -736,7 +736,7 @@ class Interface extends InterfaceConstructor {
const leading = StringPrototypeSlice(this.line, 0, this.cursor);
const reversed = ArrayPrototypeJoin(
ArrayPrototypeReverse(ArrayFrom(leading)),
''
'',
);
const match = RegExpPrototypeExec(/^\s*(?:[^\w\s]+|\w+)?/, reversed);
this[kMoveCursor](-match[0].length);
@ -775,7 +775,7 @@ class Interface extends InterfaceConstructor {
StringPrototypeSlice(
this.line,
this.cursor + charSize,
this.line.length
this.line.length,
);
this[kRefreshLine]();
}
@ -789,13 +789,13 @@ class Interface extends InterfaceConstructor {
let leading = StringPrototypeSlice(this.line, 0, this.cursor);
const reversed = ArrayPrototypeJoin(
ArrayPrototypeReverse(ArrayFrom(leading)),
''
'',
);
const match = RegExpPrototypeExec(/^\s*(?:[^\w\s]+|\w+)?/, reversed);
leading = StringPrototypeSlice(
leading,
0,
leading.length - match[0].length
leading.length - match[0].length,
);
this.line =
leading +
@ -1073,7 +1073,7 @@ class Interface extends InterfaceConstructor {
this[kSubstringSearch] = StringPrototypeSlice(
this.line,
0,
this.cursor
this.cursor,
);
}
} else if (this[kSubstringSearch] !== null) {