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

Use lowercase module name when looking up @types packages #9824

Closed
mhegazy opened this issue Jul 19, 2016 · 3 comments
Closed

Use lowercase module name when looking up @types packages #9824

mhegazy opened this issue Jul 19, 2016 · 3 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue @types Relates to working with .d.ts files (declaration/definition files) from DefinitelyTyped

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Jul 19, 2016

New NPM packages can not have uppercase letters in their names. the original package has been shipped already. May be we can make the package lookup in the compiler always look for the lower case name of the type package..

See DefinitelyTyped/DefinitelyTyped#9716 (comment)

@mhegazy mhegazy added the Bug A bug in TypeScript label Jul 19, 2016
@mhegazy mhegazy added this to the TypeScript 2.0.1 milestone Jul 19, 2016
@mhegazy mhegazy assigned ghost Jul 19, 2016
@mhegazy mhegazy added the @types Relates to working with .d.ts files (declaration/definition files) from DefinitelyTyped label Jul 19, 2016
@ghost
Copy link

ghost commented Jul 22, 2016

It appears to already work this way, even with --forceConsistentCasingInFileNames.

My setup:

src/tsconfig.json:

{
  "compilerOptions": {
    "forceConsistentCasingInFileNames": true,
    "outDir": "../out"
  }
}

node_modules/@types/foo/index.d.ts:

declare const x: number;
export default x;

node_modules/@types/bar/index.d.ts:

declare namespace Bar {
    const x: number;
}

src/index.ts:

import foo from 'FoO';
foo + 1;

src/foo-user.ts:

import foo from 'FoO';
foo + 1;

src/bar-user.ts:

/// <reference types='BaR'/>
Bar.x;

src/CAPS.ts:

export default 0;

src/caps-user.ts:

// This one really does fail.
import c from 'caps';
c + 1;

There's still a chance that this won't work on a real case-insensitive OS.

@DanielRosenwasser
Copy link
Member

The thing that flag does is yell at you if you use uppercase in one place and lowercase in another, so it's unrelated to this AFAIK.

@ghost
Copy link

ghost commented Jul 22, 2016

My bad. I guess I'll have to test this out on my linux box.

@ghost ghost closed this as completed in #10340 Aug 17, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Aug 17, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue @types Relates to working with .d.ts files (declaration/definition files) from DefinitelyTyped
Projects
None yet
Development

No branches or pull requests

2 participants