From 0b61840d74f183618f4d2226ab4aa35fdaa7296b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 7 Jul 2023 09:21:02 +0100 Subject: [PATCH 1/4] Enable strictPropertyInitialization --- tsconfig.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 3e09c30e33d..bb085989042 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,17 +7,15 @@ "module": "commonjs", "moduleResolution": "node", "target": "es2016", - "noImplicitAny": true, "noUnusedLocals": true, "sourceMap": false, "outDir": "./lib", "declaration": true, "jsx": "react", "lib": ["es2020", "dom", "dom.iterable"], - "alwaysStrict": true, - "strictBindCallApply": true, - "strictNullChecks": true, - "noImplicitThis": true + "strict": true, + "strictFunctionTypes": false, + "useUnknownInCatchVariables": false }, "include": [ "./node_modules/matrix-js-sdk/src/@types/*.d.ts", From 1ce6aacfbce034c524b7c47c28256733842c9916 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 7 Jul 2023 10:37:08 +0100 Subject: [PATCH 2/4] Enable strictFunctionTypes --- tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index bb085989042..3c0a77e8b04 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,6 @@ "jsx": "react", "lib": ["es2020", "dom", "dom.iterable"], "strict": true, - "strictFunctionTypes": false, "useUnknownInCatchVariables": false }, "include": [ From ef5ef082fca79fb0cda79eeb1e8f80dd9e122440 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 7 Jul 2023 11:47:33 +0100 Subject: [PATCH 3/4] Update to ModuleAPI 0.0.6 --- package.json | 2 +- yarn.lock | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 483892018f4..5197625659e 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ }, "dependencies": { "@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz", - "@matrix-org/react-sdk-module-api": "^0.0.5", + "@matrix-org/react-sdk-module-api": "^0.0.6", "gfm.css": "^1.1.2", "jsrsasign": "^10.5.25", "katex": "^0.16.0", diff --git a/yarn.lock b/yarn.lock index ef2875523dc..dee726dd8dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1633,6 +1633,13 @@ dependencies: "@babel/runtime" "^7.17.9" +"@matrix-org/react-sdk-module-api@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@matrix-org/react-sdk-module-api/-/react-sdk-module-api-0.0.6.tgz#941872ed081acdca9d247ccd6e146265aa24010b" + integrity sha512-FydbJYSMecpDIGk4fVQ9djjckQdbJPV9bH3px78TQ+MX/WHmzPmjEpMPTeP3uDSeg0EWmfoIFdNypJglMqAHpw== + dependencies: + "@babel/runtime" "^7.17.9" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" From 1da7218fc6bb79dd63e2986250d555b371ef201b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 7 Jul 2023 12:35:28 +0100 Subject: [PATCH 4/4] Enable typescript strict mode & remove strict tsc ci --- .github/workflows/static_analysis.yaml | 38 -------------------------- tsconfig.json | 3 +- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index 61f5c20408b..0384758a6bf 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -26,44 +26,6 @@ jobs: - name: Typecheck run: "yarn run lint:types" - tsc-strict: - name: Typescript Strict Error Checker - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - permissions: - pull-requests: read - checks: write - steps: - - uses: actions/checkout@v3 - - - name: Install Deps - run: "scripts/layered.sh" - - - name: Get diff lines - id: diff - uses: Equip-Collaboration/diff-line-numbers@e752977e2cb4207d671bb9e4dad18c07c1b73d52 # v1.1.0 - with: - include: '["\\.tsx?$"]' - - - name: Detecting files changed - id: files - uses: futuratrepadeira/changed-files@0239328a3a6268aad16af7c3e4efc78e32d6c0f0 # v4.0.1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - pattern: '^.*\.tsx?$' - - - uses: t3chguy/typescript-check-action@main - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - use-check: false - check-fail-mode: added - output-behaviour: annotate - ts-extra-args: "--strict --noImplicitAny" - files-changed: ${{ steps.files.outputs.files_updated }} - files-added: ${{ steps.files.outputs.files_created }} - files-deleted: ${{ steps.files.outputs.files_deleted }} - line-numbers: ${{ steps.diff.outputs.lineNumbers }} - i18n_lint: name: "i18n Check" uses: matrix-org/matrix-react-sdk/.github/workflows/i18n_check.yml@develop diff --git a/tsconfig.json b/tsconfig.json index 3c0a77e8b04..ac8ea2d73f6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,8 +13,7 @@ "declaration": true, "jsx": "react", "lib": ["es2020", "dom", "dom.iterable"], - "strict": true, - "useUnknownInCatchVariables": false + "strict": true }, "include": [ "./node_modules/matrix-js-sdk/src/@types/*.d.ts",