diff --git a/karma.conf.js b/karma.conf.js index 3fa59626f7..537e04f702 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -57,7 +57,7 @@ module.exports = function(config) { frameworks: ['mocha', 'chai', 'karma-typescript'], karmaTypescriptConfig: { - tsconfig: './tsconfig.json', + tsconfig: './tsconfig.base.json', compilerOptions: { checkJs: false, baseUrl: '.', diff --git a/test/e2e/tsconfig.json b/test/e2e/tsconfig.json index 4db669b079..7ab6d4a89a 100644 --- a/test/e2e/tsconfig.json +++ b/test/e2e/tsconfig.json @@ -11,5 +11,5 @@ "path": "../shared/tsconfig.json" } ], - "extends": "../../tsconfig.json" + "extends": "../../tsconfig.base.json" } diff --git a/test/perf/tsconfig.json b/test/perf/tsconfig.json index 4db669b079..7ab6d4a89a 100644 --- a/test/perf/tsconfig.json +++ b/test/perf/tsconfig.json @@ -11,5 +11,5 @@ "path": "../shared/tsconfig.json" } ], - "extends": "../../tsconfig.json" + "extends": "../../tsconfig.base.json" } diff --git a/test/screenshots/tsconfig.json b/test/screenshots/tsconfig.json index 4db669b079..7ab6d4a89a 100644 --- a/test/screenshots/tsconfig.json +++ b/test/screenshots/tsconfig.json @@ -11,5 +11,5 @@ "path": "../shared/tsconfig.json" } ], - "extends": "../../tsconfig.json" + "extends": "../../tsconfig.base.json" } diff --git a/test/shared/tsconfig.json b/test/shared/tsconfig.json index 0db6bc9211..12f1aec4f6 100644 --- a/test/shared/tsconfig.json +++ b/test/shared/tsconfig.json @@ -7,5 +7,5 @@ "checkJs": false, "allowJs": false }, - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", } diff --git a/third_party/typescript/ts_library.py b/third_party/typescript/ts_library.py index 3d47686dc1..8bebb30493 100644 --- a/third_party/typescript/ts_library.py +++ b/third_party/typescript/ts_library.py @@ -23,7 +23,7 @@ finally: NODE_LOCATION = devtools_paths.node_path() ROOT_DIRECTORY_OF_REPOSITORY = path.join(_CURRENT_DIR, '..', '..') -ROOT_TS_CONFIG_LOCATION = path.join(ROOT_DIRECTORY_OF_REPOSITORY, 'tsconfig.json') +BASE_TS_CONFIG_LOCATION = path.join(ROOT_DIRECTORY_OF_REPOSITORY, 'tsconfig.base.json') TYPES_NODE_MODULES_DIRECTORY = path.join(ROOT_DIRECTORY_OF_REPOSITORY, 'node_modules', '@types') RESOURCES_INSPECTOR_PATH = path.join(os.getcwd(), 'resources', 'inspector') @@ -54,8 +54,7 @@ def main(): parser.set_defaults(test_only=False) opts = parser.parse_args() - - with open(ROOT_TS_CONFIG_LOCATION) as root_tsconfig: + with open(BASE_TS_CONFIG_LOCATION) as root_tsconfig: try: tsconfig = json.loads(root_tsconfig.read()) except Exception as e: diff --git a/third_party/typescript/typescript.gni b/third_party/typescript/typescript.gni index 10c35fa29c..c085c90791 100644 --- a/third_party/typescript/typescript.gni +++ b/third_party/typescript/typescript.gni @@ -45,7 +45,7 @@ template("ts_library") { ]) inputs = [ - "//$devtools_location/tsconfig.json", + "//$devtools_location/tsconfig.base.json", "//$devtools_location/node_modules/typescript/lib/tsc.js", "//$devtools_location/front_end/legacy/legacy-defs.d.ts", "//$devtools_location/front_end/generated/protocol.d.ts", diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000000..a88f49eaa9 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "esnext", + "target": "esnext", + "baseUrl": ".", + "paths": { + "/front_end/*": ["front_end/*"] + }, + "checkJs": true, + "allowJs": true, + + "noEmitOnError": true, + + "lib": [ + "esnext", + "dom" + ], + + "strict": true, + "forceConsistentCasingInFileNames": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 44dd5520a6..3ef756b521 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,24 +1,10 @@ { - "compilerOptions": { - "module": "esnext", - "target": "esnext", - "baseUrl": ".", - "paths": { - "/front_end/*": ["front_end/*"] - }, - "checkJs": true, - "allowJs": true, - - "noEmitOnError": true, - - "lib": [ - "esnext", - "dom" - ], - - "strict": true, - "forceConsistentCasingInFileNames": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true - } + "extends": "./tsconfig.base.json", + "include": [ + "front_end/", + "test/" + ], + "exclude": [ + "front_end/externs.js" + ] }