Skip to content

Commit 02238a8

Browse files
committed
Upgrade TypeScript configuration
1 parent 96a5711 commit 02238a8

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

src/extension.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
TransportKind,
1313
} from 'vscode-languageclient/node';
1414

15-
let client: LanguageClient;
15+
let client: LanguageClient | undefined;
1616
let outputChannel: OutputChannel;
1717

1818
function checkPonyLspExists(): boolean {
@@ -25,7 +25,7 @@ function checkPonyLspExists(): boolean {
2525
}
2626
}
2727

28-
export async function activate(context: ExtensionContext) {
28+
export async function activate(_context: ExtensionContext) {
2929
outputChannel = window.createOutputChannel("Pony Language Server");
3030

3131
// Check if pony-lsp is available on PATH
@@ -92,15 +92,12 @@ export async function activate(context: ExtensionContext) {
9292
return client.start().catch(reason => {
9393
window.showWarningMessage(`Failed to run Pony Language Server (PLS): ${reason}`);
9494
showPony(false);
95-
client = null;
95+
client = undefined;
9696
});
9797
}
9898

99-
export function deactivate(): Thenable<void> | undefined {
100-
if (!client) {
101-
return undefined;
102-
}
103-
return client.stop();
99+
export async function deactivate(): Promise<void> {
100+
return client?.stop();
104101
}
105102

106103
export var ponyVerEntry: StatusBarItem;

tsconfig.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"compilerOptions": {
3-
"module": "commonjs",
4-
"target": "es2020",
5-
"lib": ["es2020"],
6-
"outDir": "out",
7-
"rootDir": "src",
8-
"sourceMap": true
9-
},
10-
"include": ["src"],
11-
"exclude": ["node_modules", ".vscode-test"]
12-
}
2+
"compilerOptions": {
3+
"module": "Node16",
4+
"target": "ES2022",
5+
"lib": ["ES2022"],
6+
"sourceMap": true,
7+
"rootDir": "src",
8+
"strict": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true,
11+
"noUnusedParameters": true
12+
}
13+
}

0 commit comments

Comments
 (0)