Skip to content

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

Closed

Description

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" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFix AvailableA PR has been opened for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions