Skip to content
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

Casing is not preserved when compiling <reference path="..."> triple slash directives #52110

Closed
craxal opened this issue Jan 4, 2023 · 2 comments Β· Fixed by #57681
Closed

Casing is not preserved when compiling <reference path="..."> triple slash directives #52110

craxal opened this issue Jan 4, 2023 · 2 comments Β· Fixed by #57681
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue Help Wanted You can do this
Milestone

Comments

@craxal
Copy link

craxal commented Jan 4, 2023

Bug Report

πŸ”Ž Search Terms

reference types

πŸ•— Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about triple slash directives.

⏯ Playground Link

Unable to produce playground link, as this involves the use of several files.

GitHub repository: https://github.com/craxal/triple-slash-path

πŸ’» Code

module-one/PanelWindow.d.ts

declare global {
    interface CustomWindow {
        getSomething(): any;
    }

    interface Window {
        customWindow: CustomWindow;
    }
}

module-two/Class.ts

// <reference path="../../node_modules/storage-explorer/dist/PanelWindow.d.ts" />

import * as $ from "jquery";
import { IContextMenuItem } from "storage-explorer";

export interface ICustomType {
    someProperty: string;
}

export async function doSomething(args: ICustomType): any {
    const obj = await window.customWindow.getSomething();
    return obj;
}

πŸ™ Actual behavior

The triple slash directive is compiled to something similar to the following (note the casing is not preserved, even if forceConsistentCasingInFileNames is set to true):

// <reference types="module-one/customwindow" />

Because of this issue, I cannot compile on macOS. This is not an issue on Windows.

πŸ™‚ Expected behavior

I expect the triple slash directive in module-two/Class.ts to be compiled to something similar to the following (note the casing ought to be preserved if forceConsistentCasingInFileNames is set to true):

// <reference types="module-one/CustomWindow" />
@fatcerberus
Copy link

Duplicate of #50544 and several others

@fatcerberus
Copy link

Weirdly, this seems to have been implemented this way intentionally: #10340

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this and removed Bug A bug in TypeScript labels Jan 26, 2023
@RyanCavanaugh RyanCavanaugh modified the milestone: Backlog Jan 26, 2023
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jan 26, 2023
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants