GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Request: Compiler option to specify an alternate lib.d.ts · Issue #494 · microsoft/TypeScript

Request: Compiler option to specify an alternate lib.d.ts #494

New issue
Copy link
New issue
Copy link
Closed
Closed
Request: Compiler option to specify an alternate lib.d.ts#494
Copy link
Labels
DuplicateAn existing issue was already createdAn existing issue was already createdSuggestionAn idea for TypeScriptAn idea for TypeScript

Description

@sedwards2009
Simon Edwards (sedwards2009)
opened on Aug 20, 2014
Issue body actions

The compiler has an option noLib which disables the default inclusion of lib.d.ts during compilation. Unfortunately there is no compiler option to specify a .d.ts file or files to automatically include before compiling each .ts file. Such an option would make it much easier to use an alternate lib.d.ts.

The work around now is to use the noLib option and then to add a line to each source file to manually pull in your alternate lib.d.ts.

Activity

  1. Mohamed Hegazy (mhegazy)
    added
    Bug
    on Aug 20, 2014
  2. Mohamed Hegazy (mhegazy)
    self-assigned this
    on Aug 20, 2014
  3. Mohamed Hegazy (mhegazy)
    added this to the This milestone has been deleted milestone on Aug 20, 2014
  4. NoelAbrahams commented on Aug 21, 2014

    @NoelAbrahams
    Noel Abrahams (NoelAbrahams)
    on Aug 21, 2014
    More actions

    compiler option to specify a .d.ts file or files to automatically include before compiling each .ts file. Such an option would make it much easier to use an alternate lib.d.ts.

    👍

    I believe there is a larger issue here than simply including an alternate lib.d.ts. If we have a mechanism for specifying a directory then it should be possible to add the shared declarations there, for example, node.d.ts etc.

    This would also solve the problem Split official "lib.t.ts" into different files / Special references clauses

    We have a requirement to reduce the number of global variables (properties on window) such as name, length, location etc, because it causes errors to slip through (e.g. renaming a local variable called name will fail to highlight occurrences).

  5. basarat commented on Aug 21, 2014

    @basarat
    Basarat Ali Syed (basarat)
    on Aug 21, 2014
    Contributor
    More actions

    Noel Abrahams (@NoelAbrahams) I've been bitten by item :) (not badly though)

  6. NoelAbrahams commented on Aug 21, 2014

    @NoelAbrahams
    Noel Abrahams (NoelAbrahams)
    on Aug 21, 2014
    More actions

    Basarat Ali Syed (@basarat), that's an interesting one. It's quite a significant problem. In the old codeplex site it was common for people new to TypeScript to file bugs because they couldn't understand why code like the snippet below would compile;

    var fullName: string;
    
    name = 'John Smith';
  7. mhegazy commented on Aug 21, 2014

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on Aug 21, 2014
    Contributor
    More actions

    Noel Abrahams (@NoelAbrahams) the idea of splitting lib.d.ts is that node.d.ts would take dependency on lib.core.d.ts and not the normal lib, then when you reference node.d.ts you do not get any dom types as you would expect.

    For this issue, we need two things:

    • a command line switch to allow you to specify a specific lib
    • some notion of search paths, so that when you add /// it knows you mean the one in the folder next to the compiler.
  8. Sophia J. Turner (sophiajt)
    modified the milestones: This milestone has been deleted, TypeScript 1.3 on Sep 8, 2014
  9. Dan Quirk (danquirk)
    added
    SuggestionAn idea for TypeScriptAn idea for TypeScript
    and removed
    BugA bug in TypeScriptA bug in TypeScript
    on Apr 21, 2015
  10. Mohamed Hegazy (mhegazy)
    modified the milestone: This milestone has been deleted on Apr 22, 2015
  11. Mohamed Hegazy (mhegazy)
    added
    In DiscussionNot yet reached consensusNot yet reached consensus
    on Dec 9, 2015
  12. Mohamed Hegazy (mhegazy)
    removed their assignment
    on Dec 9, 2015
  13. mhegazy commented on Feb 20, 2016

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on Feb 20, 2016
    Contributor
    More actions

    this should be covered by the proposal in #6974

  14. Mohamed Hegazy (mhegazy)
    closed this as completedon Feb 20, 2016
  15. Mohamed Hegazy (mhegazy)
    added
    DuplicateAn existing issue was already createdAn existing issue was already created
    and removed
    In DiscussionNot yet reached consensusNot yet reached consensus
    on Feb 20, 2016
  16. microsoft
    locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdAn existing issue was already createdSuggestionAn idea for TypeScriptAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.