-
Notifications
You must be signed in to change notification settings - Fork 12.9k
If resolvedFileName differs with realPath only in casing use the resolvedFileName before realpath so that errors can be reported with forceConsistentCasingInFileNames #50364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/testRunner/unittests/tsc/forceConsistentCasingInFileNames.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace ts { | ||
describe("unittests:: tsc:: forceConsistentCasingInFileNames::", () => { | ||
verifyTsc({ | ||
scenario: "forceConsistentCasingInFileNames", | ||
subScenario: "with relative and non relative file resolutions", | ||
commandLineArgs: ["/src/project/src/struct.d.ts", "--forceConsistentCasingInFileNames", "--explainFiles"], | ||
fs: () => loadProjectFromFiles({ | ||
"/src/project/src/struct.d.ts": Utils.dedent` | ||
import * as xs1 from "fp-ts/lib/Struct"; | ||
import * as xs2 from "fp-ts/lib/struct"; | ||
import * as xs3 from "./Struct"; | ||
import * as xs4 from "./struct"; | ||
`, | ||
"/src/project/node_modules/fp-ts/lib/struct.d.ts": `export function foo(): void`, | ||
}), | ||
}); | ||
}); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...e/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
Input:: | ||
//// [/lib/lib.d.ts] | ||
/// <reference no-default-lib="true"/> | ||
interface Boolean {} | ||
interface Function {} | ||
interface CallableFunction {} | ||
interface NewableFunction {} | ||
interface IArguments {} | ||
interface Number { toExponential: any; } | ||
interface Object {} | ||
interface RegExp {} | ||
interface String { charAt: any; } | ||
interface Array<T> { length: number; [n: number]: T; } | ||
interface ReadonlyArray<T> {} | ||
declare const console: { log(msg: any): void; }; | ||
|
||
//// [/src/project/node_modules/fp-ts/lib/struct.d.ts] | ||
export function foo(): void | ||
|
||
//// [/src/project/src/struct.d.ts] | ||
import * as xs1 from "fp-ts/lib/Struct"; | ||
import * as xs2 from "fp-ts/lib/struct"; | ||
import * as xs3 from "./Struct"; | ||
import * as xs4 from "./struct"; | ||
|
||
|
||
|
||
|
||
Output:: | ||
/lib/tsc /src/project/src/struct.d.ts --forceConsistentCasingInFileNames --explainFiles | ||
[96msrc/project/src/struct.d.ts[0m:[93m2[0m:[93m22[0m - [91merror[0m[90m TS1149: [0mFile name '/src/project/node_modules/fp-ts/lib/struct.d.ts' differs from already included file name '/src/project/node_modules/fp-ts/lib/Struct.d.ts' only in casing. | ||
The file is in the program because: | ||
Imported via "fp-ts/lib/Struct" from file '/src/project/src/struct.d.ts' | ||
Imported via "fp-ts/lib/struct" from file '/src/project/src/struct.d.ts' | ||
|
||
[7m2[0m import * as xs2 from "fp-ts/lib/struct"; | ||
[7m [0m [91m ~~~~~~~~~~~~~~~~~~[0m | ||
|
||
[96msrc/project/src/struct.d.ts[0m:[93m1[0m:[93m22[0m | ||
[7m1[0m import * as xs1 from "fp-ts/lib/Struct"; | ||
[7m [0m [96m ~~~~~~~~~~~~~~~~~~[0m | ||
File is included via import here. | ||
|
||
[96msrc/project/src/struct.d.ts[0m:[93m3[0m:[93m22[0m - [91merror[0m[90m TS1149: [0mFile name '/src/project/src/Struct.d.ts' differs from already included file name '/src/project/src/struct.d.ts' only in casing. | ||
The file is in the program because: | ||
Root file specified for compilation | ||
Imported via "./Struct" from file '/src/project/src/struct.d.ts' | ||
Imported via "./struct" from file '/src/project/src/struct.d.ts' | ||
|
||
[7m3[0m import * as xs3 from "./Struct"; | ||
[7m [0m [91m ~~~~~~~~~~[0m | ||
|
||
[96msrc/project/src/struct.d.ts[0m:[93m4[0m:[93m22[0m | ||
[7m4[0m import * as xs4 from "./struct"; | ||
[7m [0m [96m ~~~~~~~~~~[0m | ||
File is included via import here. | ||
|
||
lib/lib.d.ts | ||
Default library for target 'es3' | ||
src/project/node_modules/fp-ts/lib/Struct.d.ts | ||
Imported via "fp-ts/lib/Struct" from file 'src/project/src/struct.d.ts' | ||
Imported via "fp-ts/lib/struct" from file 'src/project/src/struct.d.ts' | ||
src/project/src/struct.d.ts | ||
Root file specified for compilation | ||
Imported via "./Struct" from file 'src/project/src/struct.d.ts' | ||
Imported via "./struct" from file 'src/project/src/struct.d.ts' | ||
|
||
Found 2 errors in the same file, starting at: src/project/src/struct.d.ts[90m:2[0m | ||
|
||
exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,27 +33,27 @@ export const Fragment: unique symbol; | |
export const App = () => <div propA={true}></div>; | ||
|
||
//// [/user/username/projects/myproject/tsconfig.json] | ||
{"compilerOptions":{"jsx":"react-jsx","jsxImportSource":"react","forceConsistentCasingInFileNames":true},"files":["node_modules/react/jsx-Runtime/index.d.ts","index.tsx"]} | ||
{"compilerOptions":{"jsx":"react-jsx","jsxImportSource":"react","forceConsistentCasingInFileNames":true},"files":["node_modules/react/Jsx-Runtime/index.d.ts","index.tsx"]} | ||
|
||
|
||
/a/lib/tsc.js --w --p . --explainFiles | ||
Output:: | ||
>> Screen clear | ||
[[90m12:00:31 AM[0m] Starting compilation in watch mode... | ||
|
||
[91merror[0m[90m TS1149: [0mFile name '/user/username/projects/myproject/node_modules/react/Jsx-runtime/index.d.ts' differs from already included file name '/user/username/projects/myproject/node_modules/react/jsx-Runtime/index.d.ts' only in casing. | ||
[91merror[0m[90m TS1149: [0mFile name '/user/username/projects/myproject/node_modules/react/jsx-runtime/index.d.ts' differs from already included file name '/user/username/projects/myproject/node_modules/react/Jsx-Runtime/index.d.ts' only in casing. | ||
The file is in the program because: | ||
Part of 'files' list in tsconfig.json | ||
Imported via "react/jsx-runtime" from file '/user/username/projects/myproject/index.tsx' with packageId 'react/jsx-runtime/[email protected]' to import 'jsx' and 'jsxs' factory functions | ||
|
||
[96mtsconfig.json[0m:[93m1[0m:[93m115[0m | ||
[7m1[0m {"compilerOptions":{"jsx":"react-jsx","jsxImportSource":"react","forceConsistentCasingInFileNames":true},"files":["node_modules/react/jsx-Runtime/index.d.ts","index.tsx"]} | ||
[7m1[0m {"compilerOptions":{"jsx":"react-jsx","jsxImportSource":"react","forceConsistentCasingInFileNames":true},"files":["node_modules/react/Jsx-Runtime/index.d.ts","index.tsx"]} | ||
[7m [0m [96m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m | ||
File is matched by 'files' list specified here. | ||
|
||
../../../../a/lib/lib.d.ts | ||
Default library for target 'es3' | ||
node_modules/react/jsx-Runtime/index.d.ts | ||
node_modules/react/Jsx-Runtime/index.d.ts | ||
Part of 'files' list in tsconfig.json | ||
Imported via "react/jsx-runtime" from file 'index.tsx' with packageId 'react/jsx-runtime/[email protected]' to import 'jsx' and 'jsxs' factory functions | ||
index.tsx | ||
|
@@ -62,12 +62,12 @@ index.tsx | |
|
||
|
||
|
||
Program root files: ["/user/username/projects/myproject/node_modules/react/jsx-Runtime/index.d.ts","/user/username/projects/myproject/index.tsx"] | ||
Program root files: ["/user/username/projects/myproject/node_modules/react/Jsx-Runtime/index.d.ts","/user/username/projects/myproject/index.tsx"] | ||
Program options: {"jsx":4,"jsxImportSource":"react","forceConsistentCasingInFileNames":true,"watch":true,"project":"/user/username/projects/myproject","explainFiles":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} | ||
Program structureReused: Not | ||
Program files:: | ||
/a/lib/lib.d.ts | ||
/user/username/projects/myproject/node_modules/react/jsx-Runtime/index.d.ts | ||
/user/username/projects/myproject/node_modules/react/Jsx-Runtime/index.d.ts | ||
/user/username/projects/myproject/index.tsx | ||
|
||
No cached semantic diagnostics in the builder:: | ||
|
@@ -81,7 +81,7 @@ WatchedFiles:: | |
/user/username/projects/myproject/tsconfig.json: | ||
{"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} | ||
/user/username/projects/myproject/node_modules/react/jsx-runtime/index.d.ts: | ||
{"fileName":"/user/username/projects/myproject/node_modules/react/jsx-Runtime/index.d.ts","pollingInterval":250} | ||
{"fileName":"/user/username/projects/myproject/node_modules/react/Jsx-Runtime/index.d.ts","pollingInterval":250} | ||
/user/username/projects/myproject/index.tsx: | ||
{"fileName":"/user/username/projects/myproject/index.tsx","pollingInterval":250} | ||
/a/lib/lib.d.ts: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.