tools,lib,test: enable ESLint no-regex-spaces rule

PR-URL: https://github.com/nodejs/node/pull/41463
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
This commit is contained in:
Rich Trott committed 2022-01-13 17:12:05 -08:00
1 parent 592f1845fa
commit dcc368f4be
12 files changed
+23 -22

No files matched your search

+1 -1
View File
@@ -1125,7 +1125,7 @@ assert.throws(
{
code: 'ERR_ASSERTION',
name: 'AssertionError',
message: /a: \[Getter: 5]\n- a: \[Getter: 6]\n /
message: /a: \[Getter: 5]\n- {3}a: \[Getter: 6]\n {2}/
}
);
+1 -1
View File
@@ -1247,7 +1247,7 @@ assert.throws(
assert.deepStrictEqual(Array(100).fill(1), 'foobar');
} catch (err) {
threw = true;
assert.match(inspect(err), /actual: \[Array],\n expected: 'foobar',/);
assert.match(inspect(err), /actual: \[Array],\n {2}expected: 'foobar',/);
}
assert(threw);
}
+1 -1
View File
@@ -65,7 +65,7 @@ function launchTarget(...args) {
.then(() => {
assert.match(
cli.output,
/> 3 \+\+x;/,
/> 3 {3}\+\+x;/,
'marks the 3rd line');
})
.then(() => cleanup())
@@ -9,7 +9,7 @@ process.on('uncaughtException', common.mustCall((err) => {
const lines = err.stack.split('\n');
assert.strictEqual(lines[0], 'Error');
lines.slice(1).forEach((line) => {
assert.match(line, /^ at/);
assert.match(line, /^ {4}at/);
});
}));
+3 -3
View File
@@ -12,9 +12,9 @@ server.on('stream', common.mustCall((stream) => {
assert.strictEqual(stream.aborted, false);
const insp = util.inspect(stream);
assert.match(insp, /Http2Stream {/);
assert.match(insp, / state:/);
assert.match(insp, / readableState:/);
assert.match(insp, / writableState:/);
assert.match(insp, / {2}state:/);
assert.match(insp, / {2}readableState:/);
assert.match(insp, / {2}writableState:/);
stream.end('ok');
}));
server.listen(0, common.mustCall(() => {
+1 -1
View File
@@ -35,7 +35,7 @@ r.defineCommand('say2', function() {
});
inputStream.write('.help\n');
assert.match(output, /\n\.say1 help for say1\n/);
assert.match(output, /\n\.say1 {5}help for say1\n/);
assert.match(output, /\n\.say2\n/);
inputStream.write('.say1 node developer\n');
assert.ok(output.startsWith('hello node developer\n'),
+1 -1
View File
@@ -179,7 +179,7 @@ function testError() {
// The sync error, with individual property echoes
/^Uncaught Error: ENOENT: no such file or directory, scandir '.*nonexistent\?'/,
/Object\.readdirSync/,
/^ errno: -(2|4058),$/,
/^ {2}errno: -(2|4058),$/,
" syscall: 'scandir',",
" code: 'ENOENT',",
" path: '/nonexistent?'",
+10 -10
View File
@@ -571,10 +571,10 @@ const errorTests = [
/^Uncaught Error: Cannot find module 'internal\/repl'/,
/^Require stack:/,
/^- <repl>/,
/^ at .*/,
/^ at .*/,
/^ at .*/,
/^ at .*/,
/^ {4}at .*/,
/^ {4}at .*/,
/^ {4}at .*/,
/^ {4}at .*/,
" code: 'MODULE_NOT_FOUND',",
" requireStack: [ '<repl>' ]",
'}',
@@ -776,12 +776,12 @@ const errorTests = [
' group: [Function: group],',
' groupEnd: [Function: groupEnd],',
' table: [Function: table],',
/ debug: \[Function: (debug|log)],/,
/ info: \[Function: (info|log)],/,
/ dirxml: \[Function: (dirxml|log)],/,
/ error: \[Function: (error|warn)],/,
/ groupCollapsed: \[Function: (groupCollapsed|group)],/,
/ Console: \[Function: Console],?/,
/ {2}debug: \[Function: (debug|log)],/,
/ {2}info: \[Function: (info|log)],/,
/ {2}dirxml: \[Function: (dirxml|log)],/,
/ {2}error: \[Function: (error|warn)],/,
/ {2}groupCollapsed: \[Function: (groupCollapsed|group)],/,
/ {2}Console: \[Function: Console],?/,
...process.features.inspector ? [
' profile: [Function: profile],',
' profileEnd: [Function: profileEnd],',