Skip to content

Commit 1b857b5

Browse files
committed
Enable noImplicitReturns
1 parent 1b9731e commit 1b857b5

File tree

6 files changed

+14
-2
lines changed

6 files changed

+14
-2
lines changed

packages/jupyterlab-lsp/src/adapters/adapter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,8 @@ export abstract class WidgetAdapter<T extends IDocumentWidget> {
647647
connection,
648648
virtual_document
649649
};
650+
} else {
651+
return undefined;
650652
}
651653
}
652654

packages/jupyterlab-lsp/src/editor_integration/editor_adapter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export class EditorAdapter<T extends IVirtualEditor<IEditor>> {
8888
this.console.error(e);
8989
}
9090
this.invalidateLastChange();
91+
return undefined;
9192
}
9293

9394
public invalidateLastChange() {

packages/jupyterlab-lsp/src/features/diagnostics/diagnostics.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class DiagnosticsPanel {
106106
return column;
107107
}
108108
}
109+
return undefined;
109110
};
110111

111112
/** Columns Menu **/

packages/jupyterlab-lsp/src/features/hover.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ export class HoverCM extends CodeMirrorIntegration {
494494
) {
495495
this.console.warn(e);
496496
}
497+
return undefined;
497498
}
498499
};
499500

packages/jupyterlab-lsp/src/features/jump_to.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class CMJumpToDefinition extends CodeMirrorIntegration {
9494

9595
get_uri_and_range(location_or_locations: AnyLocation) {
9696
if (location_or_locations == null) {
97-
return;
97+
return undefined;
9898
}
9999
// some language servers appear to return a single object
100100
const locations = Array.isArray(location_or_locations)
@@ -105,7 +105,7 @@ export class CMJumpToDefinition extends CodeMirrorIntegration {
105105
// (like when there are multiple definitions or usages)
106106
// could use the showHints() or completion frontend as a reference
107107
if (locations.length === 0) {
108-
return;
108+
return undefined;
109109
}
110110

111111
this.console.log(
@@ -125,6 +125,12 @@ export class CMJumpToDefinition extends CodeMirrorIntegration {
125125
uri: location_or_link.uri,
126126
range: location_or_link.range
127127
};
128+
} else {
129+
this.console.warn(
130+
'Returned jump location is incorrect (no uri or targetUri):',
131+
location_or_link
132+
);
133+
return undefined;
128134
}
129135
}
130136

packages/tsconfigbase.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"strictBindCallApply": true,
2222
"allowUnusedLabels": false,
2323
"noFallthroughCasesInSwitch": true,
24+
"noImplicitReturns": true,
2425
"types": []
2526
}
2627
}

0 commit comments

Comments
 (0)