From 6d77cf0aa4e21276f21a7842bc9838ba70953d48 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 26 Mar 2025 12:21:52 +0200 Subject: [PATCH] Make the mocker typescript tests fail on typescript errors + make tsconfig slightly stricter --- .../dynamic/init_templates/shared/package.json.hbs | 2 +- .../static/blank_template/typescript/tsconfig.json | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/codegenerator/cli/templates/dynamic/init_templates/shared/package.json.hbs b/codegenerator/cli/templates/dynamic/init_templates/shared/package.json.hbs index 984de85ae..d5ca16ae8 100644 --- a/codegenerator/cli/templates/dynamic/init_templates/shared/package.json.hbs +++ b/codegenerator/cli/templates/dynamic/init_templates/shared/package.json.hbs @@ -6,7 +6,7 @@ "clean": "tsc --clean", "build": "tsc --build", "watch": "tsc --watch", - "mocha": "ts-mocha test/**/*.ts", + "mocha": "ts-mocha -p tsconfig.json --require ts-node/register --exit test/**/*.ts", {{/if}} {{#if is_rescript}} "clean": "rescript clean", diff --git a/codegenerator/cli/templates/static/blank_template/typescript/tsconfig.json b/codegenerator/cli/templates/static/blank_template/typescript/tsconfig.json index 230241339..78a7e9a82 100644 --- a/codegenerator/cli/templates/static/blank_template/typescript/tsconfig.json +++ b/codegenerator/cli/templates/static/blank_template/typescript/tsconfig.json @@ -12,7 +12,12 @@ "esModuleInterop": true, "resolveJsonModule": true, "skipLibCheck": true, - "module": "CommonJS" + "module": "CommonJS", + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictPropertyInitialization": true, + "noImplicitThis": true, + "alwaysStrict": true }, "include": [ "src",