From da6fb98d21e9e642510494de8d256c7a7c84e932 Mon Sep 17 00:00:00 2001 From: Thomas Ip Date: Fri, 8 Feb 2019 18:51:32 +0800 Subject: [PATCH] typescript: Set appropriate compiler options. * Make type-checking stricter. * Use more modern features. --- static/ts/tsconfig.json | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/static/ts/tsconfig.json b/static/ts/tsconfig.json index 5e096a81ba..79e465ddf6 100644 --- a/static/ts/tsconfig.json +++ b/static/ts/tsconfig.json @@ -1,16 +1,23 @@ { - "compilerOptions": { - "sourceMap": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "removeComments": false, - "noImplicitAny": false, - "noFallthroughCasesInSwitch": true, - "suppressImplicitAnyIndexErrors": true, - "newLine": "lf", - "module": "commonjs", - "target": "es5", - "jsx": "react", - "allowJs": false - } + "compilerOptions": { + /* Basic options */ + "target": "es5", + "module": "es6", + "jsx": "preserve", + "sourceMap": true, + "removeComments": false, + + /* Strict type-checking */ + "strict": true, + "noImplicitAny": true, + "strictNullChecks": false, + "noImplicitThis": true, + "alwaysStrict": true, + + /* Additional checks */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + } }