From 0584a7938fd1f89397d051c323b0139f868a645c Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 4 Nov 2019 14:37:32 -0800 Subject: [PATCH] tsconfig: Move to top level. This way, webpack.config.ts is type checked. Signed-off-by: Anders Kaseorg --- .eslintrc.json | 2 +- tools/lint | 2 +- tools/run-tsc | 2 +- static/js/tsconfig.json => tsconfig.json | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) rename static/js/tsconfig.json => tsconfig.json (89%) diff --git a/.eslintrc.json b/.eslintrc.json index 7eb95650fb..0262af06a9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -416,7 +416,7 @@ "files": ["**/*.ts"], "parser": "@typescript-eslint/parser", "parserOptions": { - "project": "static/js/tsconfig.json" + "project": "tsconfig.json" }, "plugins": ["@typescript-eslint"], "rules": { diff --git a/tools/lint b/tools/lint index 792479d0ac..9a5f1e6280 100755 --- a/tools/lint +++ b/tools/lint @@ -85,7 +85,7 @@ def run(): linter_config.external_linter('mypy', command, ['py'], pass_targets=False, description="Static type checker for Python (config: mypy.ini)") linter_config.external_linter('tsc', ['tools/run-tsc'], ['ts'], pass_targets=False, - description="TypeScript compiler (config: static/js/tsconfig.json)") + description="TypeScript compiler (config: tsconfig.json)") linter_config.external_linter('yarn-deduplicate', ['tools/run-yarn-deduplicate'], ['lock'], pass_targets=False, description="Shares duplicate packages in yarn.lock") diff --git a/tools/run-tsc b/tools/run-tsc index d6bb801345..8d0f6d5bcb 100755 --- a/tools/run-tsc +++ b/tools/run-tsc @@ -1,3 +1,3 @@ #!/bin/sh ZULIP_PATH="$(dirname "$0")/.." -exec "$ZULIP_PATH/node_modules/.bin/tsc" --project "$ZULIP_PATH/static/js" "$@" +exec "$ZULIP_PATH/node_modules/.bin/tsc" --project "$ZULIP_PATH" "$@" diff --git a/static/js/tsconfig.json b/tsconfig.json similarity index 89% rename from static/js/tsconfig.json rename to tsconfig.json index 8be0995305..51de28b6e2 100644 --- a/static/js/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,9 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "*": ["types/*"], + "*": ["static/js/types/*"], }, - "typeRoots": ["types"], + "typeRoots": ["static/js/types"], /* Typescript 3.4 added the --incremental flag but its API is not * currently public so ts-loader cannot use it yet. @@ -33,6 +33,6 @@ "noFallthroughCasesInSwitch": true, }, "exclude": [ - "types", + "static/js/types", ], }