From 881cef615717d1ae944dfe4cee15c5191ec4c979 Mon Sep 17 00:00:00 2001 From: Jordi Bunster Date: Sat, 20 Mar 2021 16:45:00 -0700 Subject: [PATCH] Typescript strict mode in editor This does not change the strictness of what we build. It doesn't make things more lax either, that stays exactly the same. But the editor will now complain more. --- package.json | 4 ++-- tsconfig.build.json | 11 +++++++++++ tsconfig.json | 4 +++- tsconfig.strict.json | 7 ------- 4 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 tsconfig.build.json diff --git a/package.json b/package.json index b073d31e0..03de1bf5d 100644 --- a/package.json +++ b/package.json @@ -195,7 +195,7 @@ "watch": "npm run start", "wait-for-server": "wait-on -t 240000 -i 5000 -v https-get://0.0.0.0:1234/", "build:ase": "gulp build:ase", - "compile": "tsc", + "compile": "tsc -p ./tsconfig.build.json", "compile:contracts": "tsc -p ./tsconfig.contracts.json", "compile:strict": "tsc -p ./tsconfig.strict.json", "format": "prettier --write \"{src,test}/**/*.{ts,tsx,html}\" \"*.{js,html}\"", @@ -204,7 +204,7 @@ "build:contracts": "npm run compile:contracts", "strict:find": "node ./strict-null-checks/find.js", "strict:add": "node ./strict-null-checks/auto-add.js", - "compile:fullStrict": "tsc -p ./tsconfig.json --strictNullChecks", + "compile:fullStrict": "tsc", "generateARMClients": "ts-node --compiler-options '{\"module\":\"commonjs\"}' utils/armClientGenerator/generator.ts" }, "repository": { diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 000000000..e8d90368a --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noUnusedLocals": false, + "noUnusedParameters": false, + "noImplicitThis": false, + "strictNullChecks": false, + "strictFunctionTypes": false, + "strictBindCallApply": false + } +} diff --git a/tsconfig.json b/tsconfig.json index de751b45e..9d6fb6e96 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,9 @@ "compilerOptions": { "allowJs": true, "sourceMap": false, - "noImplicitAny": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "allowUnreachableCode": false, diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 736631ee4..cd225752b 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -1,12 +1,5 @@ { "extends": "./tsconfig.json", - "compilerOptions": { - "noEmit": true, - "strictNullChecks": true, - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true - }, "files": [ "./src/AuthType.ts", "./src/Bindings/ReactBindingHandler.ts",