Skip to content

Commit

Permalink
Remove DOM lib dependence in tsconfig (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emiyaaaaa authored Jun 25, 2024
1 parent 0e46755 commit dc35412
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test-d/set-parameter-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function function_(_a: number, _b: string, _c: Object, ..._arguments: boolean[])
return null;
}

function functionWithThis(this: Window, _a: number) {
function functionWithThis(this: Global, _a: number) {
return null;
}

Expand Down Expand Up @@ -41,5 +41,5 @@ expectType<(a: string) => null>(test5);

// Test the function that has `this` parameter
declare const testThis: SetParameterType<typeof functionWithThis, {0: string}>;
expectType<(this: Window, a: string) => null>(testThis);
testThis.call(window, '1');
expectType<(this: Global, a: string) => null>(testThis);
testThis.call(global, '1');
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"target": "ES2021", // Node.js 16
"lib": [
"ES2021",
"DOM"
],
"exactOptionalPropertyTypes": true,
"skipLibCheck": false, // Ensures .d.ts files are checked: https://github.com/sindresorhus/tsconfig/issues/15
Expand Down

0 comments on commit dc35412

Please sign in to comment.