From f1b460eceac3cee9331a7d1c6b1e198fc77e3a80 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween <5454374+emcsween@users.noreply.github.com> Date: Thu, 11 Jan 2024 08:25:25 -0500 Subject: [PATCH] Merge pull request #16385 from overleaf/em-typescript-other-services Add type checking to all services GitOrigin-RevId: f328a811fca7a783e9aff7d015ea73756acededd --- package-lock.json | 111 ++++++++++++++++-------- package.json | 3 +- services/chat/Makefile | 5 +- services/chat/package.json | 6 +- services/chat/tsconfig.json | 9 ++ services/clsi/Makefile | 5 +- services/clsi/package.json | 3 +- services/clsi/tsconfig.json | 9 ++ services/contacts/Makefile | 5 +- services/contacts/package.json | 3 +- services/contacts/tsconfig.json | 9 ++ services/docstore/Makefile | 5 +- services/docstore/package.json | 3 +- services/docstore/tsconfig.json | 9 ++ services/document-updater/Makefile | 5 +- services/document-updater/package.json | 3 +- services/document-updater/tsconfig.json | 9 ++ services/filestore/Makefile | 5 +- services/filestore/package.json | 3 +- services/filestore/tsconfig.json | 9 ++ services/history-v1/Makefile | 5 +- services/history-v1/package.json | 1 + services/history-v1/tsconfig.json | 9 ++ services/notifications/Makefile | 5 +- services/notifications/package.json | 3 +- services/notifications/tsconfig.json | 9 ++ services/project-history/Makefile | 5 +- services/project-history/package.json | 3 +- services/project-history/tsconfig.json | 9 ++ services/real-time/Makefile | 5 +- services/real-time/package.json | 1 + services/real-time/tsconfig.json | 9 ++ services/spelling/Makefile | 5 +- services/spelling/package.json | 3 +- services/spelling/tsconfig.json | 9 ++ services/web/Dockerfile | 1 + services/web/tsconfig.backend.json | 10 +-- 37 files changed, 246 insertions(+), 65 deletions(-) create mode 100644 services/chat/tsconfig.json create mode 100644 services/clsi/tsconfig.json create mode 100644 services/contacts/tsconfig.json create mode 100644 services/docstore/tsconfig.json create mode 100644 services/document-updater/tsconfig.json create mode 100644 services/filestore/tsconfig.json create mode 100644 services/history-v1/tsconfig.json create mode 100644 services/notifications/tsconfig.json create mode 100644 services/project-history/tsconfig.json create mode 100644 services/real-time/tsconfig.json create mode 100644 services/spelling/tsconfig.json diff --git a/package-lock.json b/package-lock.json index 564c805874..49761db270 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,8 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-promise": "^6.0.0", - "prettier": "2.5.1" + "prettier": "2.5.1", + "typescript": "^5.0.4" } }, "jobs/mirror-documentation": { @@ -43315,7 +43316,8 @@ "sandboxed-module": "^2.0.4", "sequelize-cli": "^6.6.0", "sinon": "^9.2.4", - "sinon-chai": "^3.7.0" + "sinon-chai": "^3.7.0", + "typescript": "^5.0.4" } }, "services/analytics/node_modules/bson": { @@ -43422,7 +43424,8 @@ "request": "^2.88.2", "sandboxed-module": "^2.0.4", "sinon": "^9.2.4", - "timekeeper": "^2.2.0" + "timekeeper": "^2.2.0", + "typescript": "^5.0.4" } }, "services/chat/node_modules/async": { @@ -43527,7 +43530,8 @@ "sandboxed-module": "^2.0.4", "sinon": "~9.0.1", "sinon-chai": "^3.7.0", - "timekeeper": "2.2.0" + "timekeeper": "2.2.0", + "typescript": "^5.0.4" } }, "services/clsi-perf": { @@ -43547,7 +43551,8 @@ "devDependencies": { "chai": "^4.3.6", "chai-as-promised": "^7.1.1", - "mocha": "^10.2.0" + "mocha": "^10.2.0", + "typescript": "^5.0.4" } }, "services/clsi-perf/node_modules/cookie": { @@ -43618,7 +43623,8 @@ "esmock": "^2.1.0", "mocha": "^10.2.0", "sinon": "~9.0.1", - "sinon-chai": "^3.7.0" + "sinon-chai": "^3.7.0", + "typescript": "^5.0.4" } }, "services/contacts/node_modules/bson": { @@ -43757,7 +43763,8 @@ "mocha": "^10.2.0", "sandboxed-module": "~2.0.4", "sinon": "~9.0.2", - "sinon-chai": "^3.7.0" + "sinon-chai": "^3.7.0", + "typescript": "^5.0.4" } }, "services/docstore/node_modules/celebrate": { @@ -43905,7 +43912,8 @@ "sandboxed-module": "^2.0.4", "sinon": "^9.2.4", "sinon-chai": "^3.7.0", - "timekeeper": "^2.0.0" + "timekeeper": "^2.0.0", + "typescript": "^5.0.4" } }, "services/document-updater/node_modules/bson": { @@ -44005,7 +44013,8 @@ "sinon": "9.0.2", "sinon-chai": "^3.7.0", "streamifier": "^0.1.1", - "timekeeper": "^2.2.0" + "timekeeper": "^2.2.0", + "typescript": "^5.0.4" } }, "services/filestore/node_modules/bson": { @@ -44134,7 +44143,8 @@ "devDependencies": { "chai": "^4.3.6", "chai-as-promised": "^7.1.1", - "mocha": "^10.2.0" + "mocha": "^10.2.0", + "typescript": "^5.0.4" } }, "services/github-sync": { @@ -44165,7 +44175,8 @@ "mocha": "^10.2.0", "sandboxed-module": "^2.0.4", "sinon": "^9.2.4", - "timekeeper": "2.2.0" + "timekeeper": "2.2.0", + "typescript": "^5.0.4" } }, "services/github-sync/node_modules/bson": { @@ -44294,6 +44305,7 @@ "node-fetch": "^2.6.7", "sinon": "^9.0.2", "swagger-client": "^3.10.0", + "typescript": "^5.0.4", "yauzl": "^2.9.1" } }, @@ -44441,7 +44453,8 @@ "devDependencies": { "chai": "^4.3.6", "chai-as-promised": "^7.1.1", - "mocha": "^10.2.0" + "mocha": "^10.2.0", + "typescript": "^5.0.4" } }, "services/latexqc": { @@ -45662,7 +45675,8 @@ "chai-as-promised": "^7.1.1", "mocha": "^10.2.0", "sandboxed-module": "^2.0.4", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" } }, "services/notifications/node_modules/bson": { @@ -45769,7 +45783,8 @@ "nock": "^12.0.3", "sinon": "~9.0.1", "sinon-chai": "^3.7.0", - "timekeeper": "2.2.0" + "timekeeper": "2.2.0", + "typescript": "^5.0.4" } }, "services/project-history/node_modules/@hapi/address": { @@ -45929,6 +45944,7 @@ "sandboxed-module": "~0.3.0", "sinon": "^9.2.4", "timekeeper": "0.0.4", + "typescript": "^5.0.4", "uid-safe": "^2.1.5" } }, @@ -45979,7 +45995,8 @@ "chai-as-promised": "^7.1.1", "mocha": "^10.2.0", "sandboxed-module": "^2.0.4", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" } }, "services/spelling": { @@ -46003,7 +46020,8 @@ "chai-as-promised": "^7.1.1", "esmock": "^2.1.0", "mocha": "^10.2.0", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" } }, "services/spelling/node_modules/underscore": { @@ -46034,7 +46052,8 @@ "chai-as-promised": "^7.1.1", "mocha": "^10.2.0", "sandboxed-module": "^2.0.4", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" } }, "services/third-party-datastore": { @@ -46068,7 +46087,8 @@ "sandboxed-module": "^2.0.4", "sinon": "9.0.1", "sinon-chai": "^3.7.0", - "sinon-stub-promise": "^4.0.0" + "sinon-stub-promise": "^4.0.0", + "typescript": "^5.0.4" } }, "services/third-party-datastore/node_modules/brace-expansion": { @@ -46188,7 +46208,8 @@ "esmock": "^2.1.0", "mocha": "^10.2.0", "sinon": "9.0.2", - "sinon-chai": "^3.7.0" + "sinon-chai": "^3.7.0", + "typescript": "^5.0.4" } }, "services/third-party-references/node_modules/bson": { @@ -46322,7 +46343,8 @@ "chai": "^4.3.6", "chai-as-promised": "^7.1.1", "chai-http": "^4.4.0", - "mocha": "^10.2.0" + "mocha": "^10.2.0", + "typescript": "^5.0.4" } }, "services/track-changes": { @@ -53702,6 +53724,7 @@ "sequelize-cli": "^6.6.0", "sinon": "^9.2.4", "sinon-chai": "^3.7.0", + "typescript": "^5.0.4", "yargs": "^17.0.0" }, "dependencies": { @@ -53760,7 +53783,8 @@ "request": "^2.88.2", "sandboxed-module": "^2.0.4", "sinon": "^9.2.4", - "timekeeper": "^2.2.0" + "timekeeper": "^2.2.0", + "typescript": "^5.0.4" }, "dependencies": { "async": { @@ -53824,6 +53848,7 @@ "sinon": "~9.0.1", "sinon-chai": "^3.7.0", "timekeeper": "2.2.0", + "typescript": "^5.0.4", "workerpool": "^6.1.5" }, "dependencies": { @@ -53874,7 +53899,8 @@ "express": "^4.18.2", "glob": "^7.2.0", "mocha": "^10.2.0", - "p-limit": "^3.1.0" + "p-limit": "^3.1.0", + "typescript": "^5.0.4" }, "dependencies": { "cookie": { @@ -53909,6 +53935,7 @@ "request": "~2.88.2", "sinon": "~9.0.1", "sinon-chai": "^3.7.0", + "typescript": "^5.0.4", "underscore": "~1.13.1" }, "dependencies": { @@ -53997,7 +54024,8 @@ "request": "^2.88.2", "sandboxed-module": "~2.0.4", "sinon": "~9.0.2", - "sinon-chai": "^3.7.0" + "sinon-chai": "^3.7.0", + "typescript": "^5.0.4" }, "dependencies": { "celebrate": { @@ -54096,7 +54124,8 @@ "sandboxed-module": "^2.0.4", "sinon": "^9.2.4", "sinon-chai": "^3.7.0", - "timekeeper": "^2.0.0" + "timekeeper": "^2.0.0", + "typescript": "^5.0.4" }, "dependencies": { "bson": { @@ -54291,7 +54320,8 @@ "sinon-chai": "^3.7.0", "streamifier": "^0.1.1", "timekeeper": "^2.2.0", - "tiny-async-pool": "^1.1.0" + "tiny-async-pool": "^1.1.0", + "typescript": "^5.0.4" }, "dependencies": { "bson": { @@ -54381,7 +54411,8 @@ "request": "^2.88.2", "sandboxed-module": "^2.0.4", "sinon": "^9.2.4", - "timekeeper": "2.2.0" + "timekeeper": "2.2.0", + "typescript": "^5.0.4" }, "dependencies": { "bson": { @@ -54427,7 +54458,8 @@ "chai-as-promised": "^7.1.1", "express": "^4.18.2", "mocha": "^10.2.0", - "samlp": "^7.0.2" + "samlp": "^7.0.2", + "typescript": "^5.0.4" } }, "@overleaf/logger": { @@ -54491,7 +54523,8 @@ "mongodb-legacy": "^6.0.1", "request": "^2.88.2", "sandboxed-module": "^2.0.4", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" }, "dependencies": { "bson": { @@ -54626,7 +54659,8 @@ "requestretry": "^7.1.0", "sinon": "~9.0.1", "sinon-chai": "^3.7.0", - "timekeeper": "2.2.0" + "timekeeper": "2.2.0", + "typescript": "^5.0.4" }, "dependencies": { "@hapi/address": { @@ -54807,6 +54841,7 @@ "socket.io": "github:overleaf/socket.io#0.9.19-overleaf-10", "socket.io-client": "github:overleaf/socket.io-client#0.9.17-overleaf-5", "timekeeper": "0.0.4", + "typescript": "^5.0.4", "uid-safe": "^2.1.5" }, "dependencies": { @@ -54867,7 +54902,8 @@ "mocha": "^10.2.0", "request": "^2.88.2", "sandboxed-module": "^2.0.4", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" } }, "@overleaf/settings": { @@ -54891,6 +54927,7 @@ "mocha": "^10.2.0", "request": "^2.88.2", "sinon": "^9.2.4", + "typescript": "^5.0.4", "underscore": "1.13.1" }, "dependencies": { @@ -54930,7 +54967,8 @@ "mongoose": "^5.13.20", "request": "^2.88.2", "sandboxed-module": "^2.0.4", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" } }, "@overleaf/third-party-datastore": { @@ -54962,7 +55000,8 @@ "sandboxed-module": "^2.0.4", "sinon": "9.0.1", "sinon-chai": "^3.7.0", - "sinon-stub-promise": "^4.0.0" + "sinon-stub-promise": "^4.0.0", + "typescript": "^5.0.4" }, "dependencies": { "brace-expansion": { @@ -55059,7 +55098,8 @@ "request": "^2.88.2", "simple-oauth2": "^5.0.0", "sinon": "9.0.2", - "sinon-chai": "^3.7.0" + "sinon-chai": "^3.7.0", + "typescript": "^5.0.4" }, "dependencies": { "bson": { @@ -55142,7 +55182,8 @@ "lodash": "^4.17.15", "mocha": "^10.2.0", "redlock": "^4.1.0", - "request": "^2.88.2" + "request": "^2.88.2", + "typescript": "^5.0.4" } }, "@overleaf/web": { @@ -69102,6 +69143,7 @@ "is-valid-hostname": "^1.0.2", "mocha": "^10.2.0", "tar-stream": "^2.2.0", + "typescript": "^5.0.4", "zlib": "^1.0.5" } }, @@ -75907,6 +75949,7 @@ "temp": "^0.8.3", "throng": "^4.0.0", "tsscmp": "^1.0.6", + "typescript": "^5.0.4", "utf-8-validate": "^5.0.4", "yauzl": "^2.9.1" }, diff --git a/package.json b/package.json index b2eb7fea04..c8ffba7734 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-promise": "^6.0.0", - "prettier": "2.5.1" + "prettier": "2.5.1", + "typescript": "^5.0.4" }, "scripts": { "format": "prettier --list-different $PWD/'**/*.js'", diff --git a/services/chat/Makefile b/services/chat/Makefile index 31d5c9b38f..4e138c8fbf 100644 --- a/services/chat/Makefile +++ b/services/chat/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/chat/package.json b/services/chat/package.json index 2b4a3ab14f..6e211fa18d 100644 --- a/services/chat/package.json +++ b/services/chat/package.json @@ -14,7 +14,8 @@ "lint": "eslint --max-warnings 0 --format unix .", "format": "prettier --list-different $PWD/'**/*.js'", "format:fix": "prettier --write $PWD/'**/*.js'", - "lint:fix": "eslint --fix ." + "lint:fix": "eslint --fix .", + "typecheck": "tsc --noEmit" }, "dependencies": { "@overleaf/logger": "*", @@ -35,7 +36,8 @@ "request": "^2.88.2", "sandboxed-module": "^2.0.4", "sinon": "^9.2.4", - "timekeeper": "^2.2.0" + "timekeeper": "^2.2.0", + "typescript": "^5.0.4" }, "version": "1.0.0", "directories": { diff --git a/services/chat/tsconfig.json b/services/chat/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/chat/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/clsi/Makefile b/services/clsi/Makefile index bdb9eb5983..8ec23e218a 100644 --- a/services/clsi/Makefile +++ b/services/clsi/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/clsi/package.json b/services/clsi/package.json index debab724a3..5858b087d8 100644 --- a/services/clsi/package.json +++ b/services/clsi/package.json @@ -43,6 +43,7 @@ "sandboxed-module": "^2.0.4", "sinon": "~9.0.1", "sinon-chai": "^3.7.0", - "timekeeper": "2.2.0" + "timekeeper": "2.2.0", + "typescript": "^5.0.4" } } diff --git a/services/clsi/tsconfig.json b/services/clsi/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/clsi/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/contacts/Makefile b/services/contacts/Makefile index f07edbc72e..527b9e4d8e 100644 --- a/services/contacts/Makefile +++ b/services/contacts/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/contacts/package.json b/services/contacts/package.json index c158776cef..d4d32340bf 100644 --- a/services/contacts/package.json +++ b/services/contacts/package.json @@ -34,6 +34,7 @@ "esmock": "^2.1.0", "mocha": "^10.2.0", "sinon": "~9.0.1", - "sinon-chai": "^3.7.0" + "sinon-chai": "^3.7.0", + "typescript": "^5.0.4" } } diff --git a/services/contacts/tsconfig.json b/services/contacts/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/contacts/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/docstore/Makefile b/services/docstore/Makefile index 6e5d3f7409..4b4ce85b69 100644 --- a/services/docstore/Makefile +++ b/services/docstore/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/docstore/package.json b/services/docstore/package.json index 5d867a4709..a5523aa90e 100644 --- a/services/docstore/package.json +++ b/services/docstore/package.json @@ -42,6 +42,7 @@ "mocha": "^10.2.0", "sandboxed-module": "~2.0.4", "sinon": "~9.0.2", - "sinon-chai": "^3.7.0" + "sinon-chai": "^3.7.0", + "typescript": "^5.0.4" } } diff --git a/services/docstore/tsconfig.json b/services/docstore/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/docstore/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/document-updater/Makefile b/services/document-updater/Makefile index 045eaa9af8..926745de83 100644 --- a/services/document-updater/Makefile +++ b/services/document-updater/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/document-updater/package.json b/services/document-updater/package.json index 56821adb8f..1f785b2d90 100644 --- a/services/document-updater/package.json +++ b/services/document-updater/package.json @@ -42,6 +42,7 @@ "sandboxed-module": "^2.0.4", "sinon": "^9.2.4", "sinon-chai": "^3.7.0", - "timekeeper": "^2.0.0" + "timekeeper": "^2.0.0", + "typescript": "^5.0.4" } } diff --git a/services/document-updater/tsconfig.json b/services/document-updater/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/document-updater/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/filestore/Makefile b/services/filestore/Makefile index f6d0b3b852..e72a3b1088 100644 --- a/services/filestore/Makefile +++ b/services/filestore/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/filestore/package.json b/services/filestore/package.json index 525329b8a5..da29037dd3 100644 --- a/services/filestore/package.json +++ b/services/filestore/package.json @@ -45,6 +45,7 @@ "sinon": "9.0.2", "sinon-chai": "^3.7.0", "streamifier": "^0.1.1", - "timekeeper": "^2.2.0" + "timekeeper": "^2.2.0", + "typescript": "^5.0.4" } } diff --git a/services/filestore/tsconfig.json b/services/filestore/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/filestore/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/history-v1/Makefile b/services/history-v1/Makefile index 3f72f92d1c..af2120c58a 100644 --- a/services/history-v1/Makefile +++ b/services/history-v1/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/history-v1/package.json b/services/history-v1/package.json index 2abf0e4246..78e569abcf 100644 --- a/services/history-v1/package.json +++ b/services/history-v1/package.json @@ -46,6 +46,7 @@ "node-fetch": "^2.6.7", "sinon": "^9.0.2", "swagger-client": "^3.10.0", + "typescript": "^5.0.4", "yauzl": "^2.9.1" }, "scripts": { diff --git a/services/history-v1/tsconfig.json b/services/history-v1/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/history-v1/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/notifications/Makefile b/services/notifications/Makefile index 18698c299d..332af4db72 100644 --- a/services/notifications/Makefile +++ b/services/notifications/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/notifications/package.json b/services/notifications/package.json index 9d2b7e1d74..220933ac1b 100644 --- a/services/notifications/package.json +++ b/services/notifications/package.json @@ -35,6 +35,7 @@ "chai-as-promised": "^7.1.1", "mocha": "^10.2.0", "sandboxed-module": "^2.0.4", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" } } diff --git a/services/notifications/tsconfig.json b/services/notifications/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/notifications/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/project-history/Makefile b/services/project-history/Makefile index 60f2b8b4e1..adfd6a80fd 100644 --- a/services/project-history/Makefile +++ b/services/project-history/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/project-history/package.json b/services/project-history/package.json index ca420c0ee1..8b0b155017 100644 --- a/services/project-history/package.json +++ b/services/project-history/package.json @@ -51,6 +51,7 @@ "nock": "^12.0.3", "sinon": "~9.0.1", "sinon-chai": "^3.7.0", - "timekeeper": "2.2.0" + "timekeeper": "2.2.0", + "typescript": "^5.0.4" } } diff --git a/services/project-history/tsconfig.json b/services/project-history/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/project-history/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/real-time/Makefile b/services/real-time/Makefile index 6227cc708f..f8c1d2ca4b 100644 --- a/services/real-time/Makefile +++ b/services/real-time/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/real-time/package.json b/services/real-time/package.json index e34829fa35..6dc5f57f7b 100644 --- a/services/real-time/package.json +++ b/services/real-time/package.json @@ -43,6 +43,7 @@ "sandboxed-module": "~0.3.0", "sinon": "^9.2.4", "timekeeper": "0.0.4", + "typescript": "^5.0.4", "uid-safe": "^2.1.5" } } diff --git a/services/real-time/tsconfig.json b/services/real-time/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/real-time/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/spelling/Makefile b/services/spelling/Makefile index 4adc3106ec..7df64b2183 100644 --- a/services/spelling/Makefile +++ b/services/spelling/Makefile @@ -45,7 +45,10 @@ lint: lint_fix: $(RUN_LINTING) lint:fix -test: format lint test_unit test_acceptance +typecheck: + $(RUN_LINTING) typecheck + +test: format lint typecheck test_unit test_acceptance test_unit: ifneq (,$(wildcard test/unit)) diff --git a/services/spelling/package.json b/services/spelling/package.json index c6b69ddd1c..edb4280dc0 100644 --- a/services/spelling/package.json +++ b/services/spelling/package.json @@ -40,6 +40,7 @@ "chai-as-promised": "^7.1.1", "esmock": "^2.1.0", "mocha": "^10.2.0", - "sinon": "^9.2.4" + "sinon": "^9.2.4", + "typescript": "^5.0.4" } } diff --git a/services/spelling/tsconfig.json b/services/spelling/tsconfig.json new file mode 100644 index 0000000000..5f4710739d --- /dev/null +++ b/services/spelling/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.backend.json", + "include": [ + "app.js", + "app/src/**/*", + "scripts/**/*", + "test/**/*" + ] +} diff --git a/services/web/Dockerfile b/services/web/Dockerfile index fd6d2d4abd..c86fc3dea1 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -49,6 +49,7 @@ FROM deps as dev ARG SENTRY_RELEASE ENV SENTRY_RELEASE=$SENTRY_RELEASE +COPY tsconfig.backend.json /overleaf/ COPY services/web /overleaf/services/web # Build the latex parser diff --git a/services/web/tsconfig.backend.json b/services/web/tsconfig.backend.json index f2bb50e130..2e2351076b 100644 --- a/services/web/tsconfig.backend.json +++ b/services/web/tsconfig.backend.json @@ -1,13 +1,5 @@ { - "compilerOptions": { - "allowJs": true, - "esModuleInterop": true, - "moduleResolution": "node", - "noEmit": true, - "noImplicitAny": false, - "skipLibCheck": true, - "strict": true - }, + "extends": "../../tsconfig.backend.json", "include": [ "app/src/**/*", "modules/*/app/src/**/*",