Skip to content

Commit 186df13

Browse files
committed
experiment: bump TypeScript to 6.0.2 and fix build errors
- Switch callable `import * as X` to default imports (picomatch, assert) - Add esModuleInterop to tsconfig - Add ignoreDeprecations: "6.0" for moduleResolution=node10
1 parent 57459c6 commit 186df13

File tree

8 files changed

+507
-259
lines changed

8 files changed

+507
-259
lines changed

package-lock.json

Lines changed: 498 additions & 252 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"node": ">=16.10.0"
4343
},
4444
"peerDependencies": {
45-
"typescript": "5.9.3"
45+
"typescript": "6.0.2"
4646
},
4747
"dependencies": {
4848
"@typescript-to-lua/language-extensions": "1.19.0",
@@ -69,7 +69,7 @@
6969
"prettier": "^2.8.8",
7070
"ts-jest": "^29.2.5",
7171
"ts-node": "^10.9.2",
72-
"typescript": "5.9.3",
72+
"typescript": "6.0.2",
7373
"typescript-eslint": "^8.46.3"
7474
}
7575
}

src/transpilation/resolve.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { couldNotReadDependency, couldNotResolveRequire } from "./diagnostics";
1010
import { BuildMode, CompilerOptions } from "../CompilerOptions";
1111
import { findLuaRequires, LuaRequire } from "./find-lua-requires";
1212
import { Plugin } from "./plugins";
13-
import * as picomatch from "picomatch";
13+
import picomatch from "picomatch";
1414

1515
const resolver = resolve.ResolverFactory.createResolver({
1616
extensions: [".lua"],

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as ts from "typescript";
2-
import * as nativeAssert from "assert";
2+
import nativeAssert from "assert";
33
import * as path from "path";
44

55
export function castArray<T>(value: T | T[]): T[];

test/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as assert from "assert";
1+
import assert from "assert";
22
import * as ts from "typescript";
33
import * as tstl from "../src";
44

test/transpile/transformers/fixtures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as assert from "assert";
1+
import assert from "assert";
22
import * as ts from "typescript";
33
import * as tstl from "../../../src";
44
import { visitAndReplace } from "./utils";

test/util.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable jest/no-standalone-expect */
2-
import * as nativeAssert from "assert";
2+
import nativeAssert from "assert";
33
import { LauxLib, Lua, LuaLib, LuaState, LUA_OK } from "lua-wasm-bindings/dist/lua";
44
import * as fs from "fs";
55
import { stringify } from "javascript-stringify";
@@ -164,6 +164,7 @@ export abstract class TestBuilder {
164164
target: ts.ScriptTarget.ES2017,
165165
lib: ["lib.esnext.d.ts"],
166166
moduleResolution: ts.ModuleResolutionKind.Node10,
167+
ignoreDeprecations: "6.0",
167168
resolveJsonModule: true,
168169
sourceMap: true,
169170
};

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"newLine": "LF",
1414
"stripInternal": true,
1515

16+
"esModuleInterop": true,
1617
"strict": true,
1718
"noUnusedLocals": true,
1819
"noUnusedParameters": true

0 commit comments

Comments
 (0)