Skip to content

Commit 350f190

Browse files
committed
Fix TypeScript compilation errors
1 parent 9780b6a commit 350f190

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

src/lit-html.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ export class Template {
313313
const attributeNameInPart =
314314
lastAttributeNameRegex.exec(stringForPart)![1];
315315
// Find the corresponding attribute
316-
const attribute = attributes.getNamedItem(attributeNameInPart);
316+
// TODO(justinfagnani): remove non-null assertion
317+
const attribute = attributes.getNamedItem(attributeNameInPart)!;
317318
const stringsForAttributeValue = attribute.value.split(markerRegex);
318319
this.parts.push(new TemplatePart(
319320
'attribute',

src/test/lib/deferred.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
*/
1919
export class Deferred<T> {
2020
readonly promise: Promise<T>;
21-
readonly resolve: (value: T) => void;
22-
readonly reject: (error: Error) => void;
21+
resolve!: (value: T) => void;
22+
reject!: (error: Error) => void;
2323

2424
constructor() {
2525
this.promise = new Promise<T>((res, rej) => {
26-
this.resolve! = res;
27-
this.reject! = rej;
26+
this.resolve = res;
27+
this.reject = rej;
2828
});
2929
}
3030
}

src/test/lib/test-async-iterable.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class TestAsyncIterable<T> implements AsyncIterable<T> {
2929
*/
3030
private _nextValue: Promise<T> =
3131
new Promise((resolve, _) => this._resolveNextValue = resolve);
32-
private _resolveNextValue: (value: T) => void;
32+
private _resolveNextValue!: (value: T) => void;
3333

3434
async * [Symbol.asyncIterator]() {
3535
while (true) {

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"sourceMap": true,
88
"inlineSources": true,
99
"outDir": "./",
10-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
1110
"strict": true,
1211
"noUnusedLocals": true,
1312
"noUnusedParameters": true,
1413
"noImplicitReturns": true,
15-
"noFallthroughCasesInSwitch": true
14+
"noFallthroughCasesInSwitch": true,
15+
"skipLibCheck": true
1616
},
1717
"include": [
1818
"src/**/*.ts"

0 commit comments

Comments
 (0)