diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts
index be72b205131..2eb261499d5 100644
--- a/src/compiler/commandLineParser.ts
+++ b/src/compiler/commandLineParser.ts
@@ -951,6 +951,7 @@ namespace ts {
{
name: "forceConsistentCasingInFileNames",
type: "boolean",
+ affectsModuleResolution: true,
category: Diagnostics.Advanced_Options,
description: Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file
},
diff --git a/src/testRunner/unittests/tscWatch/programUpdates.ts b/src/testRunner/unittests/tscWatch/programUpdates.ts
index 163ba1085ea..ce3292693a2 100644
--- a/src/testRunner/unittests/tscWatch/programUpdates.ts
+++ b/src/testRunner/unittests/tscWatch/programUpdates.ts
@@ -1228,6 +1228,35 @@ export function f(p: C) { return p; }`
]
});
+
+ verifyTscWatch({
+ scenario,
+ subScenario: "updates errors when forceConsistentCasingInFileNames changes",
+ commandLineArgs: ["-w"],
+ sys: () => {
+ const aFile: File = {
+ path: `/a.ts`,
+ content: `export class C {}`
+ };
+ const bFile: File = {
+ path: `/b.ts`,
+ content: `import {C} from './a'; import * as A from './A';`
+ };
+ const config: File = {
+ path: `/tsconfig.json`,
+ content: JSON.stringify({ compilerOptions: {} })
+ };
+ return createWatchedSystem([aFile, bFile, config, libFile], { useCaseSensitiveFileNames: false });
+ },
+ changes: [
+ sys => {
+ sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { forceConsistentCasingInFileNames: true } }));
+ sys.runQueuedTimeoutCallbacks();
+ return "Enable forceConsistentCasingInFileNames";
+ },
+ ]
+ });
+
verifyTscWatch({
scenario,
subScenario: "updates moduleResolution when resolveJsonModule changes",
diff --git a/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js
new file mode 100644
index 00000000000..f29845f27a0
--- /dev/null
+++ b/tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-forceConsistentCasingInFileNames-changes.js
@@ -0,0 +1,122 @@
+/a/lib/tsc.js -w
+//// [/a.ts]
+export class C {}
+
+//// [/b.ts]
+import {C} from './a'; import * as A from './A';
+
+//// [/tsconfig.json]
+{"compilerOptions":{}}
+
+//// [/a/lib/lib.d.ts]
+///
+interface Boolean {}
+interface Function {}
+interface CallableFunction {}
+interface NewableFunction {}
+interface IArguments {}
+interface Number { toExponential: any; }
+interface Object {}
+interface RegExp {}
+interface String { charAt: any; }
+interface Array { length: number; [n: number]: T; }
+
+//// [/a.js]
+"use strict";
+exports.__esModule = true;
+var C = /** @class */ (function () {
+ function C() {
+ }
+ return C;
+}());
+exports.C = C;
+
+
+//// [/b.js]
+"use strict";
+exports.__esModule = true;
+
+
+
+Output::
+>> Screen clear
+12:00:15 AM - Starting compilation in watch mode...
+
+
+
+12:00:20 AM - Found 0 errors. Watching for file changes.
+
+
+Program root files: ["/a.ts","/b.ts","/a/lib/lib.d.ts"]
+Program options: {"watch":true,"configFilePath":"/tsconfig.json"}
+Program files::
+/a.ts
+/b.ts
+/a/lib/lib.d.ts
+
+Semantic diagnostics in builder refreshed for::
+/a.ts
+/b.ts
+/a/lib/lib.d.ts
+
+WatchedFiles::
+/tsconfig.json:
+ {"pollingInterval":250}
+/a.ts:
+ {"pollingInterval":250}
+/b.ts:
+ {"pollingInterval":250}
+/a/lib/lib.d.ts:
+ {"pollingInterval":250}
+
+FsWatches::
+
+FsWatchesRecursive::
+/:
+ {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
+
+exitCode:: ExitStatus.undefined
+
+Change:: Enable forceConsistentCasingInFileNames
+
+//// [/tsconfig.json]
+{"compilerOptions":{"forceConsistentCasingInFileNames":true}}
+
+
+Output::
+>> Screen clear
+12:00:24 AM - File change detected. Starting incremental compilation...
+
+
+b.ts(1,43): error TS1149: File name '/A.ts' differs from already included file name '/a.ts' only in casing.
+
+
+12:00:25 AM - Found 1 error. Watching for file changes.
+
+
+Program root files: ["/a.ts","/b.ts","/a/lib/lib.d.ts"]
+Program options: {"forceConsistentCasingInFileNames":true,"watch":true,"configFilePath":"/tsconfig.json"}
+Program files::
+/a.ts
+/b.ts
+/a/lib/lib.d.ts
+
+Semantic diagnostics in builder refreshed for::
+
+WatchedFiles::
+/tsconfig.json:
+ {"pollingInterval":250}
+/a.ts:
+ {"pollingInterval":250}
+/b.ts:
+ {"pollingInterval":250}
+/a/lib/lib.d.ts:
+ {"pollingInterval":250}
+
+FsWatches::
+
+FsWatchesRecursive::
+/:
+ {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
+
+exitCode:: ExitStatus.undefined