vscode-go: create separate tsconfig for builds
Adding a separate tsconfig for builds will allow us to have strict
type checking rules enabled for editor environments before enforcing
them for builds and tests.
For golang/vscode-go#57.
Change-Id: I5059e9bbcc87258ad8accd4c476dd9d9d71f0406
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/401615
TryBot-Result: kokoro <noreply+kokoro@google.com>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 6728a57..801a598 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -33,7 +33,7 @@
"tasks": [
{
"type": "typescript",
- "tsconfig": "tsconfig.json",
+ "tsconfig": "./tsconfig.build.json",
"problemMatcher": [
"$tsc"
]
@@ -49,7 +49,7 @@
"group": {
"kind": "build",
"isDefault": true
- }
+ },
},
{
"type": "npm",
diff --git a/package.json b/package.json
index acfaa16..6af7a08 100644
--- a/package.json
+++ b/package.json
@@ -38,9 +38,9 @@
"bundle": "esbuild src/goMain.ts debugAdapter=src/debugAdapter/goDebug.ts --bundle --outdir=dist --external:vscode --format=cjs --platform=node",
"bundle-dev": "npm run bundle -- --sourcemap",
"bundle-watch": "npm run bundle -- --sourcemap --watch",
- "test-compile": "tsc -p ./",
+ "test-compile": "tsc -p ./tsconfig.build.json",
"compile": "npm run bundle",
- "watch": "tsc -watch -p ./",
+ "watch": "tsc -watch -p ./tsconfig.build.json",
"test": "npm run test-compile && node ./out/test/runTest.js",
"lint": "gts lint src test",
"fix-lint": "gts fix src test",
diff --git a/tsconfig.build.json b/tsconfig.build.json
new file mode 100644
index 0000000..c578434
--- /dev/null
+++ b/tsconfig.build.json
@@ -0,0 +1,11 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "strict": false,
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "alwaysStrict": true,
+ "strictBindCallApply": true,
+ "strictFunctionTypes": true,
+ }
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index 1b9c156..22113a9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -7,15 +7,8 @@
"lib": [
"es2017"
],
- //"strict": true,
- "noImplicitAny": true,
- "noImplicitThis": true,
- "alwaysStrict": true,
- "strictBindCallApply": true,
- "strictFunctionTypes": true,
+ "strict": true,
"esModuleInterop": true,
- //"strictNullChecks": true,
- //"strictPropertyInitialization": true,
},
"exclude": [
"node_modules",