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 — Add an option to skip ///<reference> check on d.ts files · Issue #9945 · microsoft/TypeScript

Add an option to skip ///<reference> check on d.ts files #9945

New issue
Copy link
New issue
Copy link
Closed
Closed
Add an option to skip ///<reference> check on d.ts files#9945
Copy link
Labels
Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified

Description

@saschanaz
Kagami Sascha Rosylight (saschanaz)
opened on Jul 26, 2016
Issue body actions

Related SO: http://stackoverflow.com/questions/38567936/can-typescript-module-reference-chain-be-ignored

Some libraries have jQuery or node.js support on them and the corresponding type definitions have references to jquery.d.ts and node.d.ts.

Below is an example with jsdom.d.ts:

/// <reference path='../node/node.d.ts' />
/// <reference path='../jquery/jquery.d.ts' />

import EventEmitter = NodeJS.EventEmitter;
export interface VirtualConsole extends EventEmitter {
  sendTo(console: Console): VirtualConsole;
}

export function jQueryify(window: Window, jqueryUrl: string, callback: (window: Window, jquery: JQuery) => any): void;

I want to skip node.d.ts and jquery.d.ts as I don't need them. Just excluding those files from project raises TS2304 Cannot find name, TS2503 Cannot find namespace, and TS6053 File not found. --skipLibCheck on TS 2.0 Suppresses TS2304 and TS2503 but not TS6053, so I want a new option to also suppress TS6053.

Activity

  1. Kagami Sascha Rosylight (saschanaz)
    changed the title [-]Add an option to skip ///<reference> check[/-] [+]Add an option to skip ///<reference> check on d.ts files[/+] on Jul 26, 2016
  2. basarat commented on Jul 26, 2016

    @basarat
    Basarat Ali Syed (basarat)
    on Jul 26, 2016
    Contributor
    More actions

    I'd image that any error originating form a lib definition will be surpressed with skipLibCheck. Don't want to ignore invalid file references that are not in the lib area.

  3. saschanaz commented on Jul 26, 2016

    @saschanaz
    Kagami Sascha Rosylight (saschanaz)
    on Jul 26, 2016
    ContributorAuthor
    More actions

    Basarat Ali Syed (@basarat) I think some people still want to ensure that they have all required files so that they do not meet unexpected any type. Skipping type check means a dev trusts a type definition but does not always mean the dev self-trusts.

    I would like it, however :D

  4. RyanCavanaugh commented on Oct 24, 2016

    @RyanCavanaugh
    Ryan Cavanaugh (RyanCavanaugh)
    on Oct 24, 2016
    Member
    More actions

    Isn't this basically the same as --noResolve?

  5. Ryan Cavanaugh (RyanCavanaugh)
    added
    Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified
    on Oct 24, 2016
  6. saschanaz commented on Oct 25, 2016

    @saschanaz
    Kagami Sascha Rosylight (saschanaz)
    on Oct 25, 2016
    ContributorAuthor
    More actions

    #7432 (comment)

    if you do not want the compiler to resolve any files for you, use --noResolve. but that means that all your modules will not be resolved.

    I want to resolve existing modules and ignore others. However, probably I will now just use @types and will not bother.

  7. mhegazy commented on Oct 25, 2016

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on Oct 25, 2016
    Contributor
    More actions

    My recommendation is to not use /// <reference path=".." /> or /// <reference types=".." /> all together; instead use your tsconfig.json to control what files are picked and where they are found, there are a large set of options to enable this including types, typeRoots, paths, rootDirs, and baseUrl.

    Reacted by Kagami Sascha Rosylight and Aluan Haddad
  8. Mohamed Hegazy (mhegazy)
    closed this as completedon Feb 28, 2017
  9. microsoft
    locked and limited conversation to collaborators on Jun 19, 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

    Needs More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarified

    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.