Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4518fdd

Browse filesBrowse files
Trotttargos
authored andcommitted
tools,lib,test: enable ESLint no-regex-spaces rule
PR-URL: #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>
1 parent 1f4369a commit 4518fdd
Copy full SHA for 4518fdd
Expand file treeCollapse file tree

12 files changed

+23
-22
lines changed
Open diff view settings
Collapse file

‎.eslintrc.js‎

Copy file name to clipboardExpand all lines: .eslintrc.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ module.exports = {
215215
'no-path-concat': 'error',
216216
'no-proto': 'error',
217217
'no-redeclare': ['error', { 'builtinGlobals': false }],
218+
'no-regex-spaces': 'error',
218219
'no-restricted-modules': ['error', 'sys'],
219220
/* eslint-disable max-len */
220221
'no-restricted-properties': [
Collapse file

‎lib/internal/util/inspect.js‎

Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const strEscapeSequencesReplacerSingle = /[\x00-\x1f\x5c\x7f-\x9f]|[\ud800-\udbf
188188
const keyStrRegExp = /^[a-zA-Z_][a-zA-Z_0-9]*$/;
189189
const numberRegExp = /^(0|[1-9][0-9]*)$/;
190190

191-
const coreModuleRegExp = /^ at (?:[^/\\(]+ \(|)node:(.+):\d+:\d+\)?$/;
191+
const coreModuleRegExp = /^ {4}at (?:[^/\\(]+ \(|)node:(.+):\d+:\d+\)?$/;
192192
const nodeModulesRegExp = /[/\\]node_modules[/\\](.+?)(?=[/\\])/g;
193193

194194
const classRegExp = /^(\s+[^(]*?)\s*{/;
Collapse file

‎test/parallel/test-assert-deep.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert-deep.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ assert.throws(
11251125
{
11261126
code: 'ERR_ASSERTION',
11271127
name: 'AssertionError',
1128-
message: /a: \[Getter: 5]\n- a: \[Getter: 6]\n /
1128+
message: /a: \[Getter: 5]\n- {3}a: \[Getter: 6]\n {2}/
11291129
}
11301130
);
11311131

Collapse file

‎test/parallel/test-assert.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ assert.throws(
12471247
assert.deepStrictEqual(Array(100).fill(1), 'foobar');
12481248
} catch (err) {
12491249
threw = true;
1250-
assert.match(inspect(err), /actual: \[Array],\n expected: 'foobar',/);
1250+
assert.match(inspect(err), /actual: \[Array],\n {2}expected: 'foobar',/);
12511251
}
12521252
assert(threw);
12531253
}
Collapse file

‎test/parallel/test-debugger-address.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-debugger-address.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function launchTarget(...args) {
6565
.then(() => {
6666
assert.match(
6767
cli.output,
68-
/> 3 \+\+x;/,
68+
/> 3 {3}\+\+x;/,
6969
'marks the 3rd line');
7070
})
7171
.then(() => cleanup())
Collapse file

‎test/parallel/test-events-uncaught-exception-stack.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-events-uncaught-exception-stack.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ process.on('uncaughtException', common.mustCall((err) => {
99
const lines = err.stack.split('\n');
1010
assert.strictEqual(lines[0], 'Error');
1111
lines.slice(1).forEach((line) => {
12-
assert.match(line, /^ at/);
12+
assert.match(line, /^ {4}at/);
1313
});
1414
}));
1515

Collapse file

‎test/parallel/test-http2-stream-client.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-stream-client.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ server.on('stream', common.mustCall((stream) => {
1212
assert.strictEqual(stream.aborted, false);
1313
const insp = util.inspect(stream);
1414
assert.match(insp, /Http2Stream {/);
15-
assert.match(insp, / state:/);
16-
assert.match(insp, / readableState:/);
17-
assert.match(insp, / writableState:/);
15+
assert.match(insp, / {2}state:/);
16+
assert.match(insp, / {2}readableState:/);
17+
assert.match(insp, / {2}writableState:/);
1818
stream.end('ok');
1919
}));
2020
server.listen(0, common.mustCall(() => {
Collapse file

‎test/parallel/test-repl-definecommand.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-definecommand.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ r.defineCommand('say2', function() {
3535
});
3636

3737
inputStream.write('.help\n');
38-
assert.match(output, /\n\.say1 help for say1\n/);
38+
assert.match(output, /\n\.say1 {5}help for say1\n/);
3939
assert.match(output, /\n\.say2\n/);
4040
inputStream.write('.say1 node developer\n');
4141
assert.ok(output.startsWith('hello node developer\n'),
Collapse file

‎test/parallel/test-repl-underscore.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-underscore.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function testError() {
179179
// The sync error, with individual property echoes
180180
/^Uncaught Error: ENOENT: no such file or directory, scandir '.*nonexistent\?'/,
181181
/Object\.readdirSync/,
182-
/^ errno: -(2|4058),$/,
182+
/^ {2}errno: -(2|4058),$/,
183183
" syscall: 'scandir',",
184184
" code: 'ENOENT',",
185185
" path: '/nonexistent?'",
Collapse file

‎test/parallel/test-repl.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl.js
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,10 @@ const errorTests = [
571571
/^Uncaught Error: Cannot find module 'internal\/repl'/,
572572
/^Require stack:/,
573573
/^- <repl>/,
574-
/^ at .*/,
575-
/^ at .*/,
576-
/^ at .*/,
577-
/^ at .*/,
574+
/^ {4}at .*/,
575+
/^ {4}at .*/,
576+
/^ {4}at .*/,
577+
/^ {4}at .*/,
578578
" code: 'MODULE_NOT_FOUND',",
579579
" requireStack: [ '<repl>' ]",
580580
'}',
@@ -776,12 +776,12 @@ const errorTests = [
776776
' group: [Function: group],',
777777
' groupEnd: [Function: groupEnd],',
778778
' table: [Function: table],',
779-
/ debug: \[Function: (debug|log)],/,
780-
/ info: \[Function: (info|log)],/,
781-
/ dirxml: \[Function: (dirxml|log)],/,
782-
/ error: \[Function: (error|warn)],/,
783-
/ groupCollapsed: \[Function: (groupCollapsed|group)],/,
784-
/ Console: \[Function: Console],?/,
779+
/ {2}debug: \[Function: (debug|log)],/,
780+
/ {2}info: \[Function: (info|log)],/,
781+
/ {2}dirxml: \[Function: (dirxml|log)],/,
782+
/ {2}error: \[Function: (error|warn)],/,
783+
/ {2}groupCollapsed: \[Function: (groupCollapsed|group)],/,
784+
/ {2}Console: \[Function: Console],?/,
785785
...process.features.inspector ? [
786786
' profile: [Function: profile],',
787787
' profileEnd: [Function: profileEnd],',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.