diff --git a/cli/tsc/97_ts_host.js b/cli/tsc/97_ts_host.js index b60574440b3fe0..379affda26a18b 100644 --- a/cli/tsc/97_ts_host.js +++ b/cli/tsc/97_ts_host.js @@ -317,6 +317,12 @@ const CACHE_URL_PREFIX = "cache:///"; /** Diagnostics that are intentionally ignored when compiling TypeScript in * Deno, as they provide misleading or incorrect information. */ const IGNORED_DIAGNOSTICS = [ + // TS1149: File name '...' differs from already included file name '...' only + // in casing. + 1149, + // TS1261: File name '...' differs from already included file name '...' only + // in casing. + 1261, // TS1452: 'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`. // We specify the resolution mode to be CommonJS for some npm files and this // diagnostic gets generated even though we're using custom module resolution. diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 76bb53188e6164..f7e84e4a5e579a 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -11206,6 +11206,24 @@ fn lsp_root_with_global_reference_types() { assert_eq!(json!(diagnostics.all()), json!([])); } +#[test] +#[timeout(300_000)] +fn lsp_file_casing_no_diagnostic() { + let context = TestContextBuilder::new() + .use_http_server() + .use_temp_cwd() + .build(); + let temp_dir = context.temp_dir(); + temp_dir.write("other.ts", ""); + temp_dir.write("Other.ts", ""); + let file = temp_dir.source_file("file.ts", "import \"./Other.ts\";\n"); + let mut client = context.new_lsp_command().build(); + client.initialize_default(); + // There shouldn't be a TS1149 diagnostic. + let diagnostics = client.did_open_file(&file); + assert_eq!(json!(diagnostics.all()), json!([])); +} + #[test] #[timeout(300_000)] fn lsp_diagnostics_refresh_dependents() { diff --git a/tests/specs/check/file_casing/Other.ts b/tests/specs/check/file_casing/Other.ts new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tests/specs/check/file_casing/__test__.jsonc b/tests/specs/check/file_casing/__test__.jsonc new file mode 100644 index 00000000000000..bd4e24338b9317 --- /dev/null +++ b/tests/specs/check/file_casing/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check --quiet main.ts", + "output": "" +} diff --git a/tests/specs/check/file_casing/main.ts b/tests/specs/check/file_casing/main.ts new file mode 100644 index 00000000000000..8d9e5f5eef00e5 --- /dev/null +++ b/tests/specs/check/file_casing/main.ts @@ -0,0 +1,2 @@ +import "./other.ts"; +import "./Other.ts"; diff --git a/tests/specs/check/file_casing/other.ts b/tests/specs/check/file_casing/other.ts new file mode 100644 index 00000000000000..e69de29bb2d1d6