Skip to content

Commit 0f6b16e

Browse files
committed
Fix lints
1 parent 52838c3 commit 0f6b16e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/compiler/wasm/parser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace ts.wasm {
9595
case ValueType.f32:
9696
case ValueType.f64:
9797
cursor.index++;
98-
return byte as ValueType;
98+
return byte;
9999
default:
100100
Debug.fail(`Unknown value type: ${byte}`); // TODO: Issue diagnostic
101101
}
@@ -163,7 +163,7 @@ namespace ts.wasm {
163163
case ExportKind.Global:
164164
cursor.index++;
165165
const index = parseUnsignedLEB128u32(cursor);
166-
return { kind: byte as ExportKind, index };
166+
return { kind: byte, index };
167167
default:
168168
Debug.fail(`Unknown export kind: ${byte}`); // TODO: Issue diagnostic
169169
}
@@ -217,7 +217,7 @@ namespace ts.wasm {
217217
return name;
218218
},
219219
get bytes() {
220-
this.name;
220+
void this.name; // intializes bytes
221221
return bytes;
222222
}
223223
};

src/harness/fakesHosts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace fakes {
4343

4444
public readFile(path: string) {
4545
try {
46-
let content = this.vfs.readFileSync(path, "utf8");
46+
const content = this.vfs.readFileSync(path, "utf8");
4747
if (content === undefined) {
4848
return undefined;
4949
}
@@ -56,7 +56,7 @@ namespace fakes {
5656

5757
public readFileBuffer(path: string) {
5858
try {
59-
let content = this.vfs.readFileSync(path);
59+
const content = this.vfs.readFileSync(path);
6060
if (content === undefined) {
6161
return undefined;
6262
}

src/server/scriptVersionCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ namespace ts.server {
371371
}
372372

373373
getBuffer() {
374-
return ts.sys.bufferFrom?.(this.getText(0, this.index.getLength()), "utf8") as Uint8Array; // TODO: Very unsafe, discarding `undefined`
374+
return sys.bufferFrom?.(this.getText(0, this.index.getLength()), "utf8") as Uint8Array; // TODO: Very unsafe, discarding `undefined`
375375
}
376376

377377
getLength() {

src/services/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ namespace ts {
155155
}
156156

157157
public getBuffer() {
158-
return this.buffer || (ts.sys.bufferFrom?.(this.text, "utf8") as Uint8Array);
158+
return this.buffer || (sys.bufferFrom?.(this.text, "utf8") as Uint8Array); // TODO: very unsafe, disreregards `undefined` result
159159
}
160160

161161
public getLength(): number {

0 commit comments

Comments
 (0)