Skip to content

Commit f9d0e56

Browse files
committed
chore!: update tsc target to ES2020
Minimal supported vscode version is 1.67 and it support ES2020. Earlier I used ES2015 just because it worked with 1.30 vscode, but result JS is too "obfuscated", so it makes debugging harder. Also, this version can have some features (syntax/api/etc...) which will make code cleaner.
1 parent c551590 commit f9d0e56

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

src/test/suite/formatting.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as vscode from 'vscode';
33
import { getTestEnv, TestEnv } from './env';
44
import * as utils from '../../utils';
55
import * as fs from 'fs';
6-
import path from 'path';
6+
import * as path from 'path';
77

88
function getFormattedFile(env: TestEnv) {
99
const path = env.getExtensionPath('src', 'test', 'patches', 'formatted.c');

src/test/suite/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path';
2-
import Mocha from 'mocha';
2+
import * as Mocha from 'mocha';
33
import { glob } from 'glob';
44
import { getTestEnv } from './env';
55

@@ -32,7 +32,7 @@ export function run(): Promise<void> {
3232
})
3333

3434
/* Run tests */
35-
mocha.run(failures => {
35+
mocha.run((failures: number) => {
3636
if (0 < failures) {
3737
e(new Error(`${failures} tests failed.`));
3838
} else {

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as vscode from 'vscode';
2-
import path from 'path';
2+
import * as path from 'path';
33
import * as util from 'util';
44
import * as child_process from 'child_process';
55
import { Configuration } from './extension';

tsconfig.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"compilerOptions": {
3-
"module": "Node16",
4-
"target": "ES2015",
3+
"module": "commonjs",
4+
"target": "ES2020",
55
"outDir": "out",
66
"lib": [
7-
"ES2015"
7+
"ES2020"
88
],
99
"sourceMap": true,
1010
"rootDir": "src",
@@ -13,5 +13,9 @@
1313
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
1414
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
1515
// "noUnusedParameters": true, /* Report errors on unused parameters. */
16-
}
16+
},
17+
"exclude": [
18+
"node_modules",
19+
".vscode-test"
20+
]
1721
}

0 commit comments

Comments
 (0)