This is an automated email from the ASF dual-hosted git repository.

randall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git

commit b0a33b392e173b148ce464a22fcb368af7169acd
Author: Randall Leeds <[email protected]>
AuthorDate: Sat Apr 3 22:01:47 2021 -0700

    Opt into explicit TypeScript index property access
    
    Opt into a new feature of TypeScript that restores an old behavior
    wherein accessing properties that match an index signature requires
    using bracket syntax. With this change, TypeScript will catch dotted
    attributed access that might be incorrect, but allow access with bracket
    notation that may be useful in certain scenarios.
---
 test/data-model.test.ts | 4 ++--
 tsconfig.base.json      | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/data-model.test.ts b/test/data-model.test.ts
index b7fb794..2d1d9e6 100644
--- a/test/data-model.test.ts
+++ b/test/data-model.test.ts
@@ -94,10 +94,10 @@ describe('Test JSON against Schemas', () => {
     }
   });
 
-  const assertions = MUSTS.assertions as [string];
+  const assertions = MUSTS['assertions'] as [string];
   assertions.forEach((schemaPath: string) => {
     const schema = requireJSON(`web-annotation-tests/${schemaPath}`);
-    it(schema.title as string, () => {
+    it(schema['title'] as string, () => {
       const valid = ajv.validate(schema, data);
       assert.isOk(valid, ajv.errorsText());
     });
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 0c8a2ae..3070cfb 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -14,6 +14,7 @@
       "es2020"
     ],
     "moduleResolution": "node",
+    "noPropertyAccessFromIndexSignature": true,
     "skipLibCheck": true,
     "strict": true,
     "target": "es2017"

Reply via email to