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 c694dae

Browse filesBrowse files
Trottruyadorno
authored andcommitted
test: enable no-empty ESLint rule
PR-URL: #41831 Refs: https://eslint.org/docs/rules/no-empty Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 6c82276 commit c694dae
Copy full SHA for c694dae

File tree

Expand file treeCollapse file tree

46 files changed

+206
-132
lines changed
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

46 files changed

+206
-132
lines changed
Open diff view settings
Collapse file

‎test/.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: test/.eslintrc.yaml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ env:
55
es6: true
66

77
rules:
8+
multiline-comment-style: ["error", "separate-lines"]
9+
no-empty: error
810
no-var: error
911
prefer-const: error
1012
symbol-description: off
11-
multiline-comment-style: ["error", "separate-lines"]
1213

1314
no-restricted-syntax:
1415
# Config copied from .eslintrc.js
Collapse file

‎test/addons/uv-handle-leak/test.js‎

Copy file name to clipboardExpand all lines: test/addons/uv-handle-leak/test.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ try {
1616
const { isMainThread } = require('worker_threads');
1717
if (!isMainThread)
1818
common.skip('Cannot run test in environment with clean-exit policy');
19-
} catch {}
19+
} catch {
20+
// Continue regardless of error.
21+
}
2022

2123
binding.leakHandle();
2224
binding.leakHandle(0);
Collapse file

‎test/common/inspector-helper.js‎

Copy file name to clipboardExpand all lines: test/common/inspector-helper.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ class NodeInstance extends EventEmitter {
365365
['--expose-internals'],
366366
`${scriptContents}\nprocess._rawDebug('started');`, undefined);
367367
const msg = 'Timed out waiting for process to start';
368-
while (await fires(instance.nextStderrString(), msg, TIMEOUT) !==
369-
'started') {}
368+
while (await fires(instance.nextStderrString(), msg, TIMEOUT) !== 'started');
370369
process._debugProcess(instance._process.pid);
371370
return instance;
372371
}
Collapse file

‎test/common/report.js‎

Copy file name to clipboardExpand all lines: test/common/report.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function validateContent(report, fields = []) {
4646
} catch (err) {
4747
try {
4848
err.stack += util.format('\n------\nFailing Report:\n%O', report);
49-
} catch {}
49+
} catch {
50+
// Continue regardless of error.
51+
}
5052
throw err;
5153
}
5254
}
Collapse file

‎test/internet/test-dgram-broadcast-multi-process.js‎

Copy file name to clipboardExpand all lines: test/internet/test-dgram-broadcast-multi-process.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ if (process.argv[2] !== 'child') {
184184
const buf = messages[i++];
185185

186186
if (!buf) {
187-
try { sendSocket.close(); } catch {}
187+
try { sendSocket.close(); } catch {
188+
// Continue regardless of error.
189+
}
188190
return;
189191
}
190192

Collapse file

‎test/internet/test-dgram-multicast-multi-process.js‎

Copy file name to clipboardExpand all lines: test/internet/test-dgram-multicast-multi-process.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ if (process.argv[2] !== 'child') {
170170
const buf = messages[i++];
171171

172172
if (!buf) {
173-
try { sendSocket.close(); } catch {}
173+
try { sendSocket.close(); } catch {
174+
// Continue regardless of error.
175+
}
174176
return;
175177
}
176178

Collapse file

‎test/internet/test-dgram-multicast-ssm-multi-process.js‎

Copy file name to clipboardExpand all lines: test/internet/test-dgram-multicast-ssm-multi-process.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ if (process.argv[2] !== 'child') {
164164
const buf = messages[i++];
165165

166166
if (!buf) {
167-
try { sendSocket.close(); } catch {}
167+
try { sendSocket.close(); } catch {
168+
// Continue regardless of error.
169+
}
168170
return;
169171
}
170172

Collapse file

‎test/internet/test-dgram-multicast-ssmv6-multi-process.js‎

Copy file name to clipboardExpand all lines: test/internet/test-dgram-multicast-ssmv6-multi-process.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ if (process.argv[2] !== 'child') {
164164
const buf = messages[i++];
165165

166166
if (!buf) {
167-
try { sendSocket.close(); } catch {}
167+
try { sendSocket.close(); } catch {
168+
// Continue regardless of error.
169+
}
168170
return;
169171
}
170172

Collapse file

‎test/message/vm_dont_display_runtime_error.js‎

Copy file name to clipboardExpand all lines: test/message/vm_dont_display_runtime_error.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ try {
3030
filename: 'test.vm',
3131
displayErrors: false
3232
});
33-
} catch {}
33+
} catch {
34+
// Continue regardless of error.
35+
}
3436

3537
console.error('middle');
3638

Collapse file

‎test/message/vm_dont_display_syntax_error.js‎

Copy file name to clipboardExpand all lines: test/message/vm_dont_display_syntax_error.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ try {
3030
filename: 'test.vm',
3131
displayErrors: false
3232
});
33-
} catch {}
33+
} catch {
34+
// Continue regardless of error.
35+
}
3436

3537
console.error('middle');
3638

0 commit comments

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