70 for (const [action, command] of Object.entries(DOCUMENT_COMMANDS)) {
71 context.subscriptions.push(
72 vscode.commands.registerCommand(command, () => {
73 void doc.executeCommand(action);74 })
75 );
76 }
79 vscode.commands.registerCommand(
80 "python-easy-print.easyPrintPy2",
81 () => {
82 void utils.initPrintPython2();83 }
84 )
85 );
A return;
statement with nothing after it is redundant, and has no effect on the runtime behavior of a function.
This can be confusing, so it's better to disallow these redundant statements.
function foo() { return; }
function foo() {
doSomething();
return;
}
function foo() {
if (condition) {
bar();
return;
} else {
baz();
}
}
function foo() {
switch (bar) {
case 1:
doSomething();
default:
doSomethingElse();
return;
}
}
function foo() { return 5; }
function foo() {
return doSomething();
}
function foo() {
if (condition) {
bar();
return;
} else {
baz();
}
qux();
}
function foo() {
switch (bar) {
case 1:
doSomething();
return;
default:
doSomethingElse();
}
}
function foo() {
for (const foo of bar) {
return;
}
}