_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
TypeScript/tests/cases/compiler/classFunctionMerging.ts_0_340
// We allow ambient classes and functions to merge, this way callable classes // which are also namespaces can be represented in declaration files declare function Foo (x: number): Foo.Inst; declare class Foo { constructor(x: string); } declare namespace Foo { export type Inst = number; } const a = new Foo("")...
{ "end_byte": 340, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/classFunctionMerging.ts" }
TypeScript/tests/cases/compiler/contextualTyping7.ts_0_46
var foo:{id:number;}[] = [<{id:number;}>({})];
{ "end_byte": 46, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualTyping7.ts" }
TypeScript/tests/cases/compiler/parseAssertEntriesError.ts_0_891
// @noImplicitReferences: true // @module: nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json { "name": "pkg", "version": "0.0.1", "exports": { "import": "./import.js", "require": "./require.js" } } // @filename: /node_modules/pkg/import.d.ts expo...
{ "end_byte": 891, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/parseAssertEntriesError.ts" }
TypeScript/tests/cases/compiler/mergedModuleDeclarationWithSharedExportedVar.ts_0_62
module M { export var v = 10; v; } module M { v; }
{ "end_byte": 62, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/mergedModuleDeclarationWithSharedExportedVar.ts" }
TypeScript/tests/cases/compiler/dynamicImportTrailingComma.ts_0_72
// @skipLibCheck: true // @lib: es6 const path = './foo'; import(path,);
{ "end_byte": 72, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/dynamicImportTrailingComma.ts" }
TypeScript/tests/cases/compiler/unusedFunctionsinNamespaces2.ts_0_114
//@noUnusedLocals:true //@noUnusedParameters:true namespace Validation { var function1 = function() { } }
{ "end_byte": 114, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedFunctionsinNamespaces2.ts" }
TypeScript/tests/cases/compiler/unusedPrivateMethodInClass2.ts_0_173
//@noUnusedLocals:true //@noUnusedParameters:true class greeter { private function1() { var y = 10; } private function2() { var y = 10; } }
{ "end_byte": 173, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedPrivateMethodInClass2.ts" }
TypeScript/tests/cases/compiler/tsxTypeArgumentPartialDefinitionStillErrors.ts_0_250
// @jsx: preserve // @filename: file.tsx declare namespace JSX { interface Element { render(): Element | string | false; } } function SFC<T>(props: Record<string, T>) { return ''; } <SFC<string> prop={1}></SFC>; // should error
{ "end_byte": 250, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/tsxTypeArgumentPartialDefinitionStillErrors.ts" }
TypeScript/tests/cases/compiler/es6ImportNameSpaceImport.ts_0_343
// @target: es6 // @module: commonjs // @declaration: true // @filename: es6ImportNameSpaceImport_0.ts export var a = 10; // @filename: es6ImportNameSpaceImport_1.ts import * as nameSpaceBinding from "./es6ImportNameSpaceImport_0"; var x = nameSpaceBinding.a; import * as nameSpaceBinding2 from "./es6ImportNameSpaceIm...
{ "end_byte": 343, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ImportNameSpaceImport.ts" }
TypeScript/tests/cases/compiler/classExtendsNull.ts_3_194
ass C extends null { constructor() { super(); return Object.create(null); } } class D extends null { constructor() { return Object.create(null); } }
{ "end_byte": 194, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/classExtendsNull.ts" }
TypeScript/tests/cases/compiler/blockScopedFunctionDeclarationStrictES5.ts_0_180
// @target: ES5 "use strict"; if (true) { function foo() { } // Error to declare function in block scope foo(); // This call should be ok } foo(); // Error to find name foo
{ "end_byte": 180, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/blockScopedFunctionDeclarationStrictES5.ts" }
TypeScript/tests/cases/compiler/functionCall2.ts_0_48
function foo():number{return 1}; var x = foo();
{ "end_byte": 48, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/functionCall2.ts" }
TypeScript/tests/cases/compiler/extendsClauseAlreadySeen.ts_0_58
class C { } class D extends C extends C { baz() { } }
{ "end_byte": 58, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/extendsClauseAlreadySeen.ts" }
TypeScript/tests/cases/compiler/deleteExpressionMustBeOptional.ts_0_530
// @strict: true, false interface Foo { a: number b: number | undefined c: number | null d?: number e: number | undefined | null f?: number | undefined | null g: unknown h: any i: never } interface AA { [s: string]: number } type BB = { [P in keyof any]: number } declare ...
{ "end_byte": 530, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/deleteExpressionMustBeOptional.ts" }
TypeScript/tests/cases/compiler/jsCheckObjectDefineThisNoCrash.ts_0_341
// @checkJs: true // @allowJs: true // @noEmit: true // @filename: jsCheckObjectDefineThisNoCrash.js class C { constructor() { // Neither of the following should be recognized as declarations yet Object.defineProperty(this, "_prop", { value: {} }); Object.defineProperty(this._prop, "num", { ...
{ "end_byte": 341, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsCheckObjectDefineThisNoCrash.ts" }
TypeScript/tests/cases/compiler/moduleVisibilityTest1.ts_2_1265
module OuterMod { export function someExportedOuterFunc() { return -1; } export module OuterInnerMod { export function someExportedOuterInnerFunc() { return "foo"; } } } import OuterInnerAlias = OuterMod.OuterInnerMod; module M { export module InnerMod { export function someExportedInnerFunc() { return -2; ...
{ "end_byte": 1265, "start_byte": 2, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleVisibilityTest1.ts" }
TypeScript/tests/cases/compiler/regExpWithOpenBracketInCharClass.ts_0_170
// @target: es5,es2015,esnext const regexes: RegExp[] = [ /[[]/, // Valid /[[]/u, // Valid /[[]/v, // Well-terminated regex with an incomplete character class ];
{ "end_byte": 170, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/regExpWithOpenBracketInCharClass.ts" }
TypeScript/tests/cases/compiler/jsxMultilineAttributeStringValues.tsx_0_110
// @jsx: preserve const a = <input value=" foo: 23 "></input>; const b = <input value=' foo: 23 '></input>;
{ "end_byte": 110, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsxMultilineAttributeStringValues.tsx" }
TypeScript/tests/cases/compiler/jsxPartialSpread.tsx_0_358
// @jsx: preserve // @esModuleInterop: true // @strict: true /// <reference path="/.lib/react16.d.ts" /> const Select = (p: {value?: unknown}) => <p></p>; import React from 'react'; export function Repro({ SelectProps = {} }: { SelectProps?: Partial<Parameters<typeof Select>[0]> }) { return ( <Select value...
{ "end_byte": 358, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsxPartialSpread.tsx" }
TypeScript/tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts_0_132
interface Array<T> {} var f : { <T>(x:T): T; } var g : { <S>() : S[]; }; f = g; var s = f("str").toUpperCase(); console.log(s);
{ "end_byte": 132, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts" }
TypeScript/tests/cases/compiler/doNotEmitDetachedCommentsAtStartOfLambdaFunction.ts_3_329
@removeComments: true () => { // Single line comment return 0; } () => { /* multi-line comment */ return 0; } () => { // Single line comment with more than one blank line return 0; } () => { /* multi-line comment with more than one blank line */ return 0...
{ "end_byte": 329, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/doNotEmitDetachedCommentsAtStartOfLambdaFunction.ts" }
TypeScript/tests/cases/compiler/declarationEmitClassSetAccessorParamNameInJs.ts_0_258
// @declaration: true // @emitDeclarationOnly: true // @allowJs: true // @filename: foo.js // https://github.com/microsoft/TypeScript/issues/55391 export class Foo { /** * Bar. * * @param {string} baz Baz. */ set bar(baz) {} }
{ "end_byte": 258, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitClassSetAccessorParamNameInJs.ts" }
TypeScript/tests/cases/compiler/innerExtern.ts_0_175
module A { export declare module BB { export var Elephant; } export module B { export class C { x = BB.Elephant.X; } } }
{ "end_byte": 175, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/innerExtern.ts" }
TypeScript/tests/cases/compiler/functionOverloads4.ts_0_59
function foo():number; function foo():string { return "a" }
{ "end_byte": 59, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/functionOverloads4.ts" }
TypeScript/tests/cases/compiler/parse1.ts_0_39
var bar = 42; function foo() { bar. }
{ "end_byte": 39, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/parse1.ts" }
TypeScript/tests/cases/compiler/constructorOverloads7.ts_0_471
declare class Point { x: number; y: number; constructor(x: number, y: number); add(dx: number, dy: number): Point; origin: Point; } // Type provided by extern declaration // Because Point is a constructor function, this is inferred // to be Point and return type is inferred to be void function ...
{ "end_byte": 471, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/constructorOverloads7.ts" }
TypeScript/tests/cases/compiler/returnInfiniteIntersection.ts_0_131
function recursive() { let x = <T>(subkey: T) => recursive(); return x as typeof x & { p }; } let result = recursive()(1)
{ "end_byte": 131, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/returnInfiniteIntersection.ts" }
TypeScript/tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.ts_0_230
// @module: amd // @declaration: true // @target: ES5 // @filename: server.ts class a { } export default a; // @filename: client.ts import defaultBinding, * as nameSpaceBinding from "server"; export var x = new defaultBinding();
{ "end_byte": 230, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.ts" }
TypeScript/tests/cases/compiler/typeofProperty.ts_1_769
interface I1 { a: number; b: typeof a; // Should yield error (a is not a value) } interface I2 { c: typeof d; // Should yield error (d is not a value) d: string; } interface I3 { e: typeof e; // Should yield error (e is not a value) } class C1 { a: number; b: typeof a; // Should yield err...
{ "end_byte": 769, "start_byte": 1, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typeofProperty.ts" }
TypeScript/tests/cases/compiler/commentOnArrayElement8.ts_3_43
nst array = [ 1, /* comment */ ];
{ "end_byte": 43, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/commentOnArrayElement8.ts" }
TypeScript/tests/cases/compiler/accessorDeclarationOrder.ts_0_431
// @target: esnext class C1 { #name: string; public get name() { return this.#name; } private set name(name: string) { this.#name = name; } } class C2 { #name: string; private set name(name: string) { this.#name = name; } public get name() { retu...
{ "end_byte": 431, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/accessorDeclarationOrder.ts" }
TypeScript/tests/cases/compiler/declarationFilesWithTypeReferences1.ts_0_225
// @types: node // @declaration: true // @currentDirectory: / // @filename: /node_modules/@types/node/index.d.ts interface Error { stack2: string; } // @filename: /app.ts function foo(): Error { return undefined; }
{ "end_byte": 225, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationFilesWithTypeReferences1.ts" }
TypeScript/tests/cases/compiler/promiseIdentityWithAny.ts_0_347
export interface IPromise<T, V> { then<U, W>(callback: (x: T) => IPromise<U, W>): IPromise<U, W>; } export interface Promise<T, V> { then<U, W>(callback: (x: T) => Promise<any, any>): Promise<any, any>; } // Should be ok because signature type parameters get erased to any var x: IPromise<string, number>; var x...
{ "end_byte": 347, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/promiseIdentityWithAny.ts" }
TypeScript/tests/cases/compiler/customEventDetail.ts_3_142
r x: CustomEvent; // valid since detail is any x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); var y = x.detail.name;
{ "end_byte": 142, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/customEventDetail.ts" }
TypeScript/tests/cases/compiler/emitPreComments.ts_0_282
// @removeComments: false // This is pre comment var y = 10; /** * @name Foo * @class */ /**#@+ * @memberOf Foo# * @field */ /** * @name bar * @type Object[] */ /**#@-*/ /** * @name Foo2 * @class */ /**#@+ * @memberOf Foo2# * @field */ /** * @name bar * @type Object[] */ /**#@-*/
{ "end_byte": 282, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/emitPreComments.ts" }
TypeScript/tests/cases/compiler/illegalGenericWrapping1.ts_0_272
interface Sequence<T> { each(iterator: (value: T) => void ): void; map<U>(iterator: (value: T) => U): Sequence<U>; filter(iterator: (value: T) => boolean): Sequence<T>; groupBy<K>(keySelector: (value: T) => K): Sequence<{ key: K; items: Sequence<T>; }>; }
{ "end_byte": 272, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/illegalGenericWrapping1.ts" }
TypeScript/tests/cases/compiler/argumentsPropertyNameInJsMode1.ts_0_201
// @allowJs: true // @checkJs: true // @declaration: true // @outDir: ./out // @filename: a.js const foo = { f1: (params) => { } } function f2(x) { foo.f1({ x, arguments: [] }); } f2(1, 2, 3);
{ "end_byte": 201, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/argumentsPropertyNameInJsMode1.ts" }
TypeScript/tests/cases/compiler/importExportInternalComments.ts_0_538
// @target: esnext // @filename: include.d.ts declare module "foo"; // @filename: default.ts /*1*/ export /*2*/ default /*3*/ Array /*4*/; // @filename: index.ts /*1*/ import /*2*/ D /*3*/, /*4*/ { /*5*/ A /*6*/, /*7*/ B /*8*/ as /*9*/ C /*10*/ } /*11*/ from /*12*/ "foo"; /*1*/ import /*2*/ * /*3*/ as /*4*/ foo /*5*/...
{ "end_byte": 538, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/importExportInternalComments.ts" }
TypeScript/tests/cases/compiler/jsFileCompilationWithMapFileAsJs.ts_0_151
// @allowJs: true // @sourcemap: true // @filename: a.ts class c { } // @filename: b.js.map function foo() { } // @filename: b.js function bar() { }
{ "end_byte": 151, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsFileCompilationWithMapFileAsJs.ts" }
TypeScript/tests/cases/compiler/declarationNoDanglingGenerics.ts_0_691
// @declaration: true const kindCache: { [kind: string]: boolean } = {}; function register(kind: string): void | never { if (kindCache[kind]) { throw new Error(`Class with kind "${kind}" is already registered.`); } kindCache[kind] = true; } function ClassFactory<TKind extends string>(kind: TKind) { regist...
{ "end_byte": 691, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationNoDanglingGenerics.ts" }
TypeScript/tests/cases/compiler/stringIndexerAssignments2.ts_0_185
class C1 { [index: string]: string one: string; } class C2 { one: string; } class C3 { one: number; two: string; } var x: C1; var a: C2; var b: C3; x = a; x = b;
{ "end_byte": 185, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/stringIndexerAssignments2.ts" }
TypeScript/tests/cases/compiler/narrowingUnionToNeverAssigment.ts_0_182
// @strict: true type Variants = "a" | "b" | "c" | "d"; function fx1(x: Variants) { if (x === "a" || x === "b") { } else { const y: never = x; } }
{ "end_byte": 182, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/narrowingUnionToNeverAssigment.ts" }
TypeScript/tests/cases/compiler/targetEs6DecoratorMetadataImportNotElided.ts_0_408
// @module: es6 // @target: es5 // @emitDecoratorMetadata: true // @experimentalDecorators: true // @filename: deps.ts export function Input(): any { } export class TemplateRef { } // @filename: index.ts import { Input, TemplateRef } from './deps'; export class MyComponent { _ref: TemplateRef; @Input() g...
{ "end_byte": 408, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/targetEs6DecoratorMetadataImportNotElided.ts" }
TypeScript/tests/cases/compiler/enumAssignmentCompat5.ts_0_495
enum E { A, B, C } enum Computed { A = 1 << 1, B = 1 << 2, C = 1 << 3, } let n: number; let e: E = n; // ok because it's too inconvenient otherwise e = 0; // ok, in range e = 4; // ok, out of range, but allowed computed enums don't have all members let a: E.A = 0; // ok, A === 0 a = 2; // error, 2 !== 0...
{ "end_byte": 495, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/enumAssignmentCompat5.ts" }
TypeScript/tests/cases/compiler/assignmentCompatability43.ts_0_451
module __test1__ { export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { export interface interfaceTwo<T,U> { one: T; two: U; }; var obj2: inte...
{ "end_byte": 451, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/assignmentCompatability43.ts" }
TypeScript/tests/cases/compiler/assignmentToObjectAndFunction.ts_0_602
var errObj: Object = { toString: 0 }; // Error, incompatible toString var goodObj: Object = { toString(x?) { return ""; } }; // Ok, because toString is a subtype of Object's toString var errFun: Function = {}; // Error for no call signature function foo() { } module foo { export var boom = 0; } v...
{ "end_byte": 602, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/assignmentToObjectAndFunction.ts" }
TypeScript/tests/cases/compiler/binopAssignmentShouldHaveType.ts_0_246
// @lib: es5 declare var console; "use strict"; module Test { export class Bug { getName():string { return "name"; } bug() { var name:string= null; if ((name= this.getName()).length > 0) { console.log(name); } } } }
{ "end_byte": 246, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binopAssignmentShouldHaveType.ts" }
TypeScript/tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts_0_193
//@module: commonjs // @declaration: true export module a { export module b { export interface I { foo(); } } } import b = a.b; export var x: b.I; x.foo();
{ "end_byte": 193, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts" }
TypeScript/tests/cases/compiler/infinitelyExpandingTypeAssignability.ts_0_155
interface A<T> { x : T } interface B<T> extends A<B<B<B<T>>>> { } interface C<T> extends A<C<C<C<T>>>> { } var x : B<string> var y : C<string> = x
{ "end_byte": 155, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/infinitelyExpandingTypeAssignability.ts" }
TypeScript/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts_0_969
// @lib: es5 // @sourcemap: true interface Robot { name: string; skill: string; } declare var console: { log(msg: string): void; } var hello = "hello"; var robotA: Robot = { name: "mower", skill: "mowing" }; var robotB: Robot = { name: "trimmer", skill: "trimming" }; var a: string, { name: nameA } = robotA;...
{ "end_byte": 969, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts" }
TypeScript/tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.ts_0_49
// @sourcemap: true ((item: string) => item )
{ "end_byte": 49, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapValidationLambdaSpanningMultipleLines.ts" }
TypeScript/tests/cases/compiler/declarationEmitDefaultExportWithTempVarName.ts_0_84
// @declaration: true // @module: system // @Filename: pi.ts export default 3.14159;
{ "end_byte": 84, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitDefaultExportWithTempVarName.ts" }
TypeScript/tests/cases/compiler/thisInLambda.ts_0_330
class Foo { x = "hello"; bar() { this.x; // 'this' is type 'Foo' var f = () => this.x; // 'this' should be type 'Foo' as well } } function myFn(a:any) { } class myCls { constructor () { myFn(() => { myFn(() => { var x = this; }); }...
{ "end_byte": 330, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/thisInLambda.ts" }
TypeScript/tests/cases/compiler/noCollisionThisExpressionAndLocalVarInConstructor.ts_0_392
class class1 { constructor() { var x2 = { doStuff: (callback) => () => { var _this = 2; return callback(_this); } } } } class class2 { constructor() { var _this = 2; var x2 = { doStuff: (callback) => () => {...
{ "end_byte": 392, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noCollisionThisExpressionAndLocalVarInConstructor.ts" }
TypeScript/tests/cases/compiler/awaitedType.ts_0_7563
// @target: esnext // @strictNullChecks: false type T1 = Awaited<number>; type T2 = Awaited<Promise<number>>; type T3 = Awaited<number | Promise<number>>; type T4 = Awaited<number | Promise<string>>; type T5 = Awaited<{ then: number }>; type T6 = Awaited<{ then(): void }>; // never (non-promise "thenable") type T7 = A...
{ "end_byte": 7563, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/awaitedType.ts" }
TypeScript/tests/cases/compiler/indexedAccessConstraints.ts_0_517
// @strict: true // @noEmit: true function foo<T extends object>(a: T[keyof T]) { let b: number = a; // Error } // Repro from #54522 export function methodFnLength<T extends {}, K extends keyof T>(obj: T, methodKey: K): number { const fn = obj[methodKey]; if (typeof fn !== 'function') { return 0...
{ "end_byte": 517, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/indexedAccessConstraints.ts" }
TypeScript/tests/cases/compiler/es6ModuleConstEnumDeclaration.ts_0_581
// @target: ES6 export const enum e1 { a, b, c } const enum e2 { x, y, z } var x = e1.a; var y = e2.x; export module m1 { export const enum e3 { a, b, c } const enum e4 { x, y, z } var x1 = e1.a; var y1 = e2.x; var x2 = ...
{ "end_byte": 581, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ModuleConstEnumDeclaration.ts" }
TypeScript/tests/cases/compiler/jsFileFunctionOverloads.ts_0_1022
// @allowJs: true // @outDir: dist/ // @declaration: true // @filename: jsFileFunctionOverloads.js /** * @overload * @param {number} x * @returns {'number'} */ /** * @overload * @param {string} x * @returns {'string'} */ /** * @overload * @param {boolean} x * @returns {'boolean'} */ /** * @param {unknown}...
{ "end_byte": 1022, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsFileFunctionOverloads.ts" }
TypeScript/tests/cases/compiler/unusedInvalidTypeArguments.ts_0_1016
// Tests that types are marked as used, even if used in places that don't accept type arguments. // @noUnusedLocals: true // @Filename: /typeReference.ts type N = number; type U = number; export type Z = U<N>; // @Filename: /classReference.ts type N = number; class C { } // This uses getTypeFromClassOrInterfaceRefer...
{ "end_byte": 1016, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedInvalidTypeArguments.ts" }
TypeScript/tests/cases/compiler/narrowingPlainJsNoCrash1.ts_0_218
// @allowJs: true // @checkJs: false // @outDir: true // @filename: index.js // https://github.com/microsoft/TypeScript/issues/59594 var a$b = {}; var c, d; d = a$b; while (d !== a$b); while ((c = a$b != a$b)) c.e;
{ "end_byte": 218, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/narrowingPlainJsNoCrash1.ts" }
TypeScript/tests/cases/compiler/abstractClassUnionInstantiation.ts_0_736
class ConcreteA {} class ConcreteB {} abstract class AbstractA { a: string; } abstract class AbstractB { b: string; } type Abstracts = typeof AbstractA | typeof AbstractB; type Concretes = typeof ConcreteA | typeof ConcreteB; type ConcretesOrAbstracts = Concretes | Abstracts; declare const cls1: ConcretesOrAbstracts;...
{ "end_byte": 736, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/abstractClassUnionInstantiation.ts" }
TypeScript/tests/cases/compiler/narrowByClauseExpressionInSwitchTrue10.ts_0_1014
// @strict: true // @noEmit: true function foo(cond1: boolean, cond2: boolean) { switch (true) { case cond1 || cond2: cond1; // boolean // ^? cond2; // boolean // ^? break; case cond2: cond1; // false // ^? ...
{ "end_byte": 1014, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/narrowByClauseExpressionInSwitchTrue10.ts" }
TypeScript/tests/cases/compiler/assignmentCompatability12.ts_0_338
module __test1__ { export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { export var obj = {one: "1"}; export var __val__obj = obj; } __test2__.__val__obj = __t...
{ "end_byte": 338, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/assignmentCompatability12.ts" }
TypeScript/tests/cases/compiler/functionsInClassExpressions.ts_0_151
let Foo = class { constructor() { this.bar++; } bar = 0; inc = () => { this.bar++; } m() { return this.bar; } }
{ "end_byte": 151, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/functionsInClassExpressions.ts" }
TypeScript/tests/cases/compiler/umdGlobalAugmentationNoCrash.ts_0_375
// @strict: true // @module: esnext // @moduleResolution: node // @target: es2018 // @filename: global.d.ts declare global { const React: typeof import("./module"); } export {}; // @filename: module.d.ts export as namespace React; export function foo(): string; // @filename: some_module.ts export {} React.foo; /...
{ "end_byte": 375, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/umdGlobalAugmentationNoCrash.ts" }
TypeScript/tests/cases/compiler/deferredConditionalTypes2.ts_0_1102
// @strict: true // @noEmit: true // https://github.com/microsoft/TypeScript/issues/56270 type PositiveInfinity = 1e999; type NegativeInfinity = -1e999; export type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends < G, >() => G extends B ? 1 : 2 ? true : false; export type Add<A extends number, B extend...
{ "end_byte": 1102, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/deferredConditionalTypes2.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_0_1502
// Repro from #10697 (function (define, undefined) { define(function () { 'use strict'; var impl = {}; impl.mobileDetectRules = { "phones": { "iPhone": "\\biPhone\\b|\\biPod\\b", "BlackBerry": "BlackBerry|\\bBB10\\b|rim[0-9]+", "HTC": "HTC|HTC.*(Sensation|Evo|Vision|Explorer|6...
{ "end_byte": 1502, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_0_3645
Samsung|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-...
{ "end_byte": 3645, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_3645_6818
30|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SG...
{ "end_byte": 6818, "start_byte": 3645, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_6827_9330
"LG": "\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|...
{ "end_byte": 9330, "start_byte": 6827, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_9335_12773
"tablets": { "iPad": "iPad|iPad.*Mobile", "NexusTablet": "Android.*Nexus[\\s]+(7|9|10)", "SamsungTablet": "SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|S...
{ "end_byte": 12773, "start_byte": 9335, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_12782_16701
"PrestigioTablet": "PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297...
{ "end_byte": 16701, "start_byte": 12782, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_16710_20501
"PantechTablet": "Pantech.*P4100", "BronchoTablet": "Broncho.*(N701|N708|N802|a710)", "VersusTablet": "TOUCHPAD.*[78910]|\\bTOUCHTAB\\b", "ZyncTablet": "z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900", "PositivoTablet": "TB07STA|TB10STA|TB07FTA|TB10FTA", "NabiTablet": "Android.*\...
{ "end_byte": 20501, "start_byte": 16710, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_20510_24315
"VistureTablet": "V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10", "CrestaTablet": "CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989", "MediatekTablet": "\\bMT8125|MT8389|MT8135|MT8377\\b", "ConcordeTablet": "Concorde([ ]+...
{ "end_byte": 24315, "start_byte": 20510, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_24324_27685
"TeclastTablet": "T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\...
{ "end_byte": 27685, "start_byte": 24324, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_27690_32709
"oss": { "AndroidOS": "Android", "BlackBerryOS": "blackberry|\\bBB10\\b|rim tablet os", "PalmOS": "PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino", "SymbianOS": "Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b", "WindowsMobileOS": "Windows CE.*(PPC|Smartphone|Mobile...
{ "end_byte": 32709, "start_byte": 27690, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_32714_38019
impl.detectMobileBrowsers = { fullPattern: /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(brow...
{ "end_byte": 38019, "start_byte": 32714, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_38025_42611
/** * Test userAgent string against a set of rules and return an array of matched keys. * @param {Object} rules (key is String, value is RegExp) * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent'). * @returns {Array} an array of matched keys, may be empty when there is ...
{ "end_byte": 42611, "start_byte": 38025, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_42616_48783
impl.mobileGrade = function (t) { // impl note: // To keep in sync w/ Mobile_Detect.php easily, the following code is tightly aligned to the PHP version. // When changes are made in Mobile_Detect.php, copy this method and replace: // $this-> / t. // self::MOBILE_GRADE_(.)...
{ "end_byte": 48783, "start_byte": 42616, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_48789_50509
/** * Constructor for MobileDetect object. * <br> * Such an object will keep a reference to the given user-agent string and cache most of the detect queries.<br> * <div style="background-color: #d9edf7; border: 1px solid #bce8f1; color: #3a87ad; padding: 14px; border-radius: 2px; margin-top: 20px"> ...
{ "end_byte": 50509, "start_byte": 48789, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_50515_57766
MobileDetect.prototype = { constructor: MobileDetect, /** * Returns the detected phone or tablet type or <tt>null</tt> if it is not a mobile device. * <br> * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.<br> * <b...
{ "end_byte": 57766, "start_byte": 50515, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_57776_65930
/** * Returns the (first) detected user-agent string or <tt>null</tt>. * <br> * The returned user-agent is one of following keys:<br> * <br><tt>Vivaldi, Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, * Blazer, Safari, Tizen, UCBrowser, baiduboxapp, baidub...
{ "end_byte": 65930, "start_byte": 57776, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/fixSignatureCaching.ts_65940_67392
/** * Returns the mobile grade ('A', 'B', 'C'). * * @returns {String} one of the mobile grades ('A', 'B', 'C'). * @function MobileDetect#mobileGrade */ mobileGrade: function () { if (this._cache.grade === undefined) { this._cache.grade = i...
{ "end_byte": 67392, "start_byte": 65940, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/fixSignatureCaching.ts" }
TypeScript/tests/cases/conformance/inferFromBindingPattern.ts_0_1012
// @strict: true declare function f1<T extends string>(): T; declare function f2<T extends string>(): [T]; declare function f3<T extends string>(): { x: T }; let x1 = f1(); // string let [x2] = f2(); // string let { x: x3 } = f3(); // string // Repro from #30379 function foo<T = number>(): [T] { ret...
{ "end_byte": 1012, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/inferFromBindingPattern.ts" }
TypeScript/tests/cases/conformance/directives/ts-expect-error-js.ts_0_194
// @allowJs: true // @checkJs: true // @noEmit: true // @fileName: a.js // there should be a "Unused @ts-expect-error" error since js files are being checked // @ts-expect-error const a = 1;
{ "end_byte": 194, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/directives/ts-expect-error-js.ts" }
TypeScript/tests/cases/conformance/directives/multiline.tsx_0_815
// @filename: a.ts export const texts: string[] = []; /** @ts-ignore */ texts.push(100); /** @ts-expect-error */ texts.push(100); /** @ts-expect-error */ texts.push("100"); // @filename: b.tsx // @jsx: react // @libFiles: react.d.ts,lib.d.ts import * as React from "react"; export function MyComponent(props: { f...
{ "end_byte": 815, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/directives/multiline.tsx" }
TypeScript/tests/cases/conformance/directives/ts-expect-error-nocheck.ts_0_133
// @ts-nocheck // there should not be a "Unused @ts-expect-error" error due to the // @ts-nocheck // @ts-expect-error const a = 1;
{ "end_byte": 133, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/directives/ts-expect-error-nocheck.ts" }
TypeScript/tests/cases/conformance/directives/ts-ignore.ts_0_527
// @ts-ignore with additional commenting var invalidCommentedFancy: number = 'nope'; // @ts-ignore with additional commenting var validCommentedFancy: string = 'nope'; // @ts-ignore var invalidCommentedPlain: number = 'nope'; // @ts-ignore var validCommentedPlain: string = 'nope'; var invalidPlain: number = 'nope';...
{ "end_byte": 527, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/directives/ts-ignore.ts" }
TypeScript/tests/cases/conformance/directives/ts-expect-error-nocheck-js.ts_0_203
// @allowJs: true // @checkJs: false // @noEmit: true // @fileName: a.js // there should not be a "Unused @ts-expect-error" error since js files are not being checked // @ts-expect-error const a = 1;
{ "end_byte": 203, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/directives/ts-expect-error-nocheck-js.ts" }
TypeScript/tests/cases/conformance/directives/ts-expect-error.ts_0_1279
// @ts-expect-error additional commenting var invalidCommentedFancySingle: number = 'nope'; /* @ts-expect-error additional commenting */ var invalidCommentedFancyMulti: number = 'nope'; // @ts-expect-error additional commenting var validCommentedFancySingle: string = 'nope'; /* @ts-expect-error additional commentin...
{ "end_byte": 1279, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/directives/ts-expect-error.ts" }
TypeScript/tests/cases/conformance/nonjsExtensions/declarationFileForHtmlImport.ts_0_812
// @lib: es2020,dom // @target: es2020 // @allowArbitraryExtensions: true,false // @filename: component.d.html.ts // html modules were proposed at https://github.com/WICG/webcomponents/blob/gh-pages/proposals/html-modules-explainer.md // per proposal, `default` is user-defined, but if not present, will be the documen...
{ "end_byte": 812, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/nonjsExtensions/declarationFileForHtmlImport.ts" }
TypeScript/tests/cases/conformance/nonjsExtensions/declarationFileForHtmlFileWithinDeclarationFile.ts_0_829
// @lib: es2020,dom // @target: es2020 // @filename: component.d.html.ts // html modules were proposed at https://github.com/WICG/webcomponents/blob/gh-pages/proposals/html-modules-explainer.md // per proposal, `default` is user-defined, but if not present, will be the document of the imported module declare var doc:...
{ "end_byte": 829, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/nonjsExtensions/declarationFileForHtmlFileWithinDeclarationFile.ts" }
TypeScript/tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts_0_380
// @lib: es2020,dom // @target: es2020 // @allowArbitraryExtensions: true,false // @module: nodenext // @filename: package.json {"type": "module"} // @filename: dir/package.json {"type": "commonjs"} // @filename: dir/native.d.node.ts export function doNativeThing(flag: string): unknown; // @filename: main.ts import mod...
{ "end_byte": 380, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/nonjsExtensions/declarationFilesForNodeNativeModules.ts" }
TypeScript/tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts_0_1392
// @allowArbitraryExtensions: true // @module: nodenext // @filename: package.json {"type": "module"} // @filename: main.ts import def1 from "./file.js"; import def2 from "./file.jsx"; import def3 from "./file.ts"; import def4 from "./file.tsx"; import def5 from "./file.mjs"; import def6 from "./file.cjs"; import def7 ...
{ "end_byte": 1392, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/nonjsExtensions/declarationFileForTsJsImport.ts" }
TypeScript/tests/cases/conformance/nonjsExtensions/declarationFileForJsonImport.ts_0_245
// @allowArbitraryExtensions: true // @resolveJsonModule: true,false // @filename: main.ts import data from "./data.json"; let x: string = data; // @filename: data.json {} // @filename: data.d.json.ts declare var val: string; export default val;
{ "end_byte": 245, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/nonjsExtensions/declarationFileForJsonImport.ts" }
TypeScript/tests/cases/conformance/moduleResolution/declarationNotFoundPackageBundlesTypes.ts_0_460
// @noImplicitAny: true // @noImplicitReferences: true // @filename: node_modules/foo/package.json { "name": "foo", "version": "1.0.0" } // @filename: node_modules/foo/index.js var foo = 0; module.exports = foo; // @filename: node_modules/foo/index.d.ts declare const foo: any; export = foo; // @filename:...
{ "end_byte": 460, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/moduleResolution/declarationNotFoundPackageBundlesTypes.ts" }
TypeScript/tests/cases/conformance/moduleResolution/typesVersions.justIndex.ts_0_292
// @baseUrl: / // @traceResolution: true // @target: esnext // @module: commonjs // @filename: /a/package.json { "typesVersions": { ">=3.1.0-0": { "*" : ["ts3.1/*"] } } } // @filename: /a/ts3.1/index.d.ts export const a = 0; // @filename: /b/user.ts import { a } from "a";
{ "end_byte": 292, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/moduleResolution/typesVersions.justIndex.ts" }
TypeScript/tests/cases/conformance/moduleResolution/node10Alternateresult_noTypes.ts_0_474
// @moduleResolution: node10 // @noImplicitAny: true // @traceResolution: true // @noEmit: true // @noTypesAndSymbols: true // @Filename: /node_modules/pkg/package.json { "name": "pkg", "version": "1.0.0", "main": "./untyped.js", "exports": { ".": "./definitely-not-index.js" } } // @Filename: /node_mo...
{ "end_byte": 474, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/moduleResolution/node10Alternateresult_noTypes.ts" }
TypeScript/tests/cases/conformance/moduleResolution/selfNameModuleAugmentation.ts_0_1343
// @moduleResolution: bundler // @module: esnext // @allowJs: true // @noEmit: true // @traceResolution: true // @Filename: /node_modules/acorn-walk/package.json { "name": "acorn-walk", "version": "8.2.0", "main": "dist/walk.js", "types": "dist/walk.d.ts", "exports": { ".": [ { "import": ...
{ "end_byte": 1343, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/moduleResolution/selfNameModuleAugmentation.ts" }
TypeScript/tests/cases/conformance/moduleResolution/nodeModulesAtTypesPriority.ts_0_626
// @module: node16 // @strict: true // @noEmit: true // @traceResolution: true // @Filename: /node_modules/@types/react/index.d.ts declare const React: any; export = React; // @Filename: /node_modules/@types/redux/index.d.ts export declare function createStore(): void; // @Filename: /packages/a/node_modules/react/in...
{ "end_byte": 626, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/moduleResolution/nodeModulesAtTypesPriority.ts" }