Skip to content

Commit c49fb63

Browse files
committed
Enable TypeScript noPropertyAccessFromIndexSignature
1 parent e82ce7c commit c49fb63

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

examples/recursive.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ test("circular objects", () => {
155155
};
156156

157157
// Make the object circular:
158-
alice.likes = bob;
158+
// Make the object circular:
159+
alice["likes"] = bob;
159160

160161
// Calling the decoder would cause infinite recursion!
161162
// So be careful when working with recursive data!

tests/repr.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ test("object", () => {
424424
`,
425425
);
426426
const circular: Record<string, unknown> = {};
427-
circular.circular = circular;
428-
circular.other = { a: [{ other: 1, circular }] };
427+
circular["circular"] = circular;
428+
circular["other"] = { a: [{ other: 1, circular }] };
429429
expect(repr(circular, { depth: Infinity })).toMatchInlineSnapshot(`
430430
{
431431
"circular": circular Object(2),

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"noFallthroughCasesInSwitch": true,
1111
"noImplicitOverride": true,
1212
"noImplicitReturns": true,
13+
"noPropertyAccessFromIndexSignature": true,
1314
"noUncheckedIndexedAccess": true,
1415
"skipLibCheck": true,
1516
"strict": true,

0 commit comments

Comments
 (0)