_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
TypeScript/tests/cases/conformance/jsdoc/importTag17.ts_0_802 | // @module: node16
// @checkJs: true
// @allowJs: true
// @noEmit: true
// @Filename: /node_modules/@types/foo/package.json
{
"name": "@types/foo",
"version": "1.0.0",
"exports": {
".": {
"import": "./index.d.mts",
"require": "./index.d.cts"
}
}
}
// @Filename: ... | {
"end_byte": 802,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag17.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefOnStatements.ts_0_1515 | // @strict: true
// @declaration: true
// @outdir: out/
// @filename: typedefOnStatements.js
// @checkJs: true
/** @typedef {{a: string}} A */
;
/** @typedef {{ b: string }} B */
debugger;
/** @typedef {{ c: string }} C */
{
}
/** @typedef {{ d: string }} D */
1 + 1;
/** @typedef {{ e: string }} E */
if (false) {
}
/*... | {
"end_byte": 1515,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefOnStatements.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag4.ts_0_276 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /types.ts
export interface Foo {
a: number;
}
// @filename: /foo.js
/**
* @import { Foo } from "./types"
*/
/**
* @import { Foo } from "./types"
*/
/**
* @param { Foo } foo
*/
function f(foo) {}
| {
"end_byte": 276,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag4.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/extendsTag5.ts_0_591 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /a.js
/**
* @typedef {{
* a: number | string;
* b: boolean | string[];
* }} Foo
*/
/**
* @template {Foo} T
*/
class A {
/**
* @param {T} a
*/
constructor(a) {
return a
}
}
/**
* @extends {A<{
* a: string,
* b:... | {
"end_byte": 591,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/extendsTag5.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts_0_606 | // @strict: true
// grammar error from checker
var ara: Array.<number> = [1,2,3];
function f(x: ?number, y: Array.<number>) {
return x ? x + y[1] : y[0];
}
function hof(ctor: function(new: number, string)) {
return new ctor('hi');
}
function hof2(f: function(this: number, string): string) {
return f(12, '... | {
"end_byte": 606,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/parseLinkTag.ts_0_112 | /** trailing @link tag {@link */
var x;
/** @returns trailing @link tag {@link */
function f() {
return x
}
| {
"end_byte": 112,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/parseLinkTag.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefTagExtraneousProperty.ts_0_331 | // @lib: es5
// @allowjs: true
// @checkjs: true
// @noemit: true
// @Filename: typedefTagExtraneousProperty.js
/** @typedef {Object.<string,string>} Mmap
* @property {string} ignoreMe - should be ignored
*/
/** @type {Mmap} */
var y = { bye: "no" };
y
y.ignoreMe = "ok but just because of the index signature"
y['hi... | {
"end_byte": 331,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefTagExtraneousProperty.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag6.ts_0_343 | // @noEmit: true
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/**
* @typedef {Object} Point2d
* @property {number} x
* @property {number} y
*/
// Undesirable behavior today with type annotation
const a = /** @satisfies {Partial<Point2d>} */ ({ x: 10 });
// Should OK
console.log(a.x.toFixed());
// Sho... | {
"end_byte": 343,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag6.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocLinkTag3.ts_0_198 | // @noUnusedLocals: true
// @filename: /a.ts
export interface A {}
// @filename: /b.ts
import type { A } from "./a";
/**
* @param {number} a - see {@link A}
*/
export function foo(a: string) {}
| {
"end_byte": 198,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocLinkTag3.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag16.ts_0_291 | // @declaration: true
// @emitDeclarationOnly: true
// @checkJs: true
// @allowJs: true
// @filename: a.ts
export default interface Foo {}
export interface I {}
// @filename: b.js
/** @import Foo, { I } from "./a" */
/**
* @param {Foo} a
* @param {I} b
*/
export function foo(a, b) {}
| {
"end_byte": 291,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag16.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefCrossModule5.ts_0_203 | // @pretty: true
// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: mod1.js
/** @typedef {number} Foo */
class Bar {}
// @Filename: mod2.js
class Foo { } // should error
const Bar = 3;
| {
"end_byte": 203,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefCrossModule5.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocImplements_missingType.ts_0_201 | // @allowJs: true
// @checkJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @outDir: ./out
// @Filename: /a.js
class A { constructor() { this.x = 0; } }
/** @implements */
class B {
}
| {
"end_byte": 201,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocImplements_missingType.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag22.ts_0_797 | // @noEmit: true
// @module: preserve
// @noTypesAndSymbols: true
// @Filename: node_modules/tslib/package.json
{
"name": "tslib",
"exports": {
".": {
"module": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
},
"import": {
... | {
"end_byte": 797,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag22.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/exportedAliasedEnumTag.ts_0_173 | // @noemit: true
// @allowjs: true
// @filename: exportedAliasedEnumTag.js
var middlewarify = module.exports = {};
/** @enum */
middlewarify.Type = {
BEFORE: 'before'
};
| {
"end_byte": 173,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/exportedAliasedEnumTag.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag5.ts_0_268 | // @checkJs: true
// @allowJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @filename: /types.ts
export interface Foo {
a: number;
}
// @filename: /foo.js
/**
* @import { Foo } from "./types"
*/
/**
* @param { Foo } foo
*/
function f(foo) {}
| {
"end_byte": 268,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag5.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/extendsTag4.ts_0_175 | // @allowJs: true
// @checkJs: true
// @target: esnext
// @outDir: out
// @Filename: foo.js
/**
* @constructor
*/
class A {
constructor() {}
}
/**
* @extends {A}
*/
| {
"end_byte": 175,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/extendsTag4.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/errorIsolation.ts_0_145 | // @noEmit: true
// @checkJs: true
// @filename: errorIsolation.js
const async = { doSomething: _ => {} };
async.doSomething(
/***/
() => {}
); | {
"end_byte": 145,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/errorIsolation.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocCatchClauseWithTypeAnnotation.ts_0_2411 | // @allowJs: true
// @checkJs: true
// @target: esnext
// @noImplicitAny: true
// @outDir: out
// @Filename: foo.js
/**
* @typedef {any} Any
*/
/**
* @typedef {unknown} Unknown
*/
function fn() {
try { } catch (x) { } // should be OK
try { } catch (/** @type {an... | {
"end_byte": 2411,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocCatchClauseWithTypeAnnotation.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/tsNoCheckForTypescript.ts_0_359 | // @declaration: true
// @filename: file.ts
// @ts-nocheck
export const a = 1 + {}; // This is an error, ofc, `Operator '+' cannot be applied to types '1' and '{}'`, which will be suppressed by the `nocheck` comment
export interface Aleph {
q: number;
}
export class Bet implements Aleph {
q: string = "lol" ... | {
"end_byte": 359,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/tsNoCheckForTypescript.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag14.ts_0_222 | // @noEmit: true
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/**
* @typedef {Object} T1
* @property {number} a
*/
/**
* @satisfies T1
*/
const t1 = { a: 1 };
const t2 = /** @satisfies T1 */ ({ a: 1 });
| {
"end_byte": 222,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag14.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocImplements_signatures.ts_0_236 | // @allowJs: true
// @checkJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @outDir: ./out
// @Filename: /defs.d.ts
interface Sig {
[index: string]: string
}
// @Filename: /a.js
/** @implements {Sig} */
class B {
}
| {
"end_byte": 236,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocImplements_signatures.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTemplateTagDefault.ts_0_1691 | // @allowJs: true
// @checkJs: true
// @declaration: true
// @outDir: out
// @Filename: file.js
/**
* @template {string | number} [T=string] - ok: defaults are permitted
* @typedef {[T]} A
*/
/** @type {A} */ // ok, default for `T` in `A` is `string`
const aDefault1 = [""];
/** @type {A} */ // error: `number` is n... | {
"end_byte": 1691,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTemplateTagDefault.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typeTagPrototypeAssignment.ts_0_135 | // @Filename: bug27327.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
function C() {
}
/** @type {string} */
C.prototype = 12
| {
"end_byte": 135,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typeTagPrototypeAssignment.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/callbackTagNamespace.ts_0_315 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: namespaced.js
/**
* @callback NS.Nested.Inner
* @param {Object} space - spaaaaaaaaace
* @param {Object} peace - peaaaaaaaaace
* @return {string | number}
*/
var x = 1;
/** @type {NS.Nested.Inner} */
function f(space, peace) {
return '1'
}
| {
"end_byte": 315,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/callbackTagNamespace.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTemplateTag8.ts_0_1147 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/**
* @template out T
* @typedef {Object} Covariant
* @property {T} x
*/
/**
* @type {Covariant<unknown>}
*/
let super_covariant = { x: 1 };
/**
* @type {Covariant<string>}
*/
let sub_covariant = { x: '' };
super_covari... | {
"end_byte": 1147,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTemplateTag8.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag2.ts_0_250 | // @noEmit: true
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/** @typedef {Object.<string, (n: number) => boolean>} Predicates */
const p = /** @satisfies {Predicates} */ ({
isEven: n => n % 2 === 0,
isOdd: n => n % 2 === 1
});
| {
"end_byte": 250,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocOverrideTag1.ts_0_579 | // @allowJS: true
// @checkJS: true
// @noEmit: true
// @noImplicitOverride: true
// @Filename: 0.js
class A {
/**
* @method
* @param {string | number} a
* @returns {boolean}
*/
foo (a) {
return typeof a === 'string'
}
bar () {
}
}
class B extends A {
/**
* @... | {
"end_byte": 579,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocOverrideTag1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocLinkTag7.ts_0_326 | // @checkJs: true
// @allowJs: true
// @target: esnext
// @noEmit: true
// @filename: /a.js
class Foo {
/**
* {@linkcode this.a}
* {@linkcode this.#c}
*
* {@link this.a}
* {@link this.#c}
*
* {@linkplain this.a}
* {@linkplain this.#c}
*/
a() { }
b() { }
#c() ... | {
"end_byte": 326,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocLinkTag7.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typeParameterExtendsUnionConstraintDistributed.ts_0_208 | type A = 1 | 2;
function f<T extends A>(a: T): A & T { return a; } // Shouldn't error
type B = 2 | 3;
function f2<T extends A, U extends B>(ab: T & U): (A | B) & T & U { return ab; } // Also shouldn't error
| {
"end_byte": 208,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typeParameterExtendsUnionConstraintDistributed.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag12.ts_0_104 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /foo.js
/**
* @import foo from
*/
| {
"end_byte": 104,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag12.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/constructorTagOnClassConstructor.ts_0_204 | // @allowJs: true
// @noEmit: true
// @checkJs: true
// @Filename: bug27025.js
export class Alpha { }
export class Beta {
/**
* @constructor
*/
constructor() {
}
}
const arr = [Alpha, Beta];
| {
"end_byte": 204,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/constructorTagOnClassConstructor.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag10.ts_0_433 | // @noEmit: true
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/** @typedef {"a" | "b" | "c" | "d"} Keys */
const p = /** @satisfies {Partial<Record<Keys, unknown>>} */ ({
a: 0,
b: "hello",
x: 8 // Should error, 'x' isn't in 'Keys'
});
// Should be OK -- retain info that a is number and b is st... | {
"end_byte": 433,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag10.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/callbackOnConstructor.ts_0_346 | // @filename: callbackOnConstructor.js
// @checkJs: true
// @outdir: dist
// @declaration: true
export class Preferences {
assignability = "no"
/**
* @callback ValueGetter_2
* @param {string} name
* @returns {boolean|number|string|undefined}
*/
constructor() {}
}
/** @type {ValueGetter_2} */
var oos... | {
"end_byte": 346,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/callbackOnConstructor.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocNeverUndefinedNull.ts_0_186 | // @allowJs: true
// @filename: in.js
// @outFile: out.js
/**
* @param {never} p1
* @param {undefined} p2
* @param {null} p3
* @returns {void} nothing
*/
function f(p1, p2, p3) {
}
| {
"end_byte": 186,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocNeverUndefinedNull.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag1.ts_0_233 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /types.ts
export interface Foo {
a: number;
}
// @filename: /foo.js
/**
* @import { Foo } from "./types"
*/
/**
* @param { Foo } foo
*/
function f(foo) {}
| {
"end_byte": 233,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocReadonlyDeclarations.ts_0_547 | // @allowJs: true
// @checkJs: true
// @target: esnext
// @outFile: foo.js
// @declaration: true
// @Filename: jsdocReadonlyDeclarations.js
// @useDefineForClassFields: false
class C {
/** @readonly */
x = 6
/** @readonly */
constructor(n) {
this.x = n
/**
* @readonly
*... | {
"end_byte": 547,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocReadonlyDeclarations.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocAccessibilityTags.ts_0_1122 | // @allowJs: true
// @checkJs: true
// @target: esnext
// @noEmit: true
// @Filename: jsdocAccessibilityTag.js
class A {
/**
* Ap docs
*
* @private
*/
priv = 4;
/**
* Aq docs
*
* @protected
*/
prot = 5;
/**
* Ar docs
*
* @public
*/
pub... | {
"end_byte": 1122,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocAccessibilityTags.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/paramTagWrapping.ts_0_408 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: good.js
/**
* @param
* {number} x Arg x.
* @param {number}
* y Arg y.
* @param {number} z
* Arg z.
*/
function good(x, y, z) {
}
good(1, 2, 3)
// @Filename: bad.js
/**
* @param *
* {number} x Arg x.
* @param {number}
* ... | {
"end_byte": 408,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/paramTagWrapping.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/enumTagOnExports.ts_0_172 | // @filename: enumTagOnExports.js
// @allowjs: true
// @checkjs: true
// @noemit: true
/** @enum {number} */
exports.a = {};
/** @enum {string} */
module.exports.b = {};
| {
"end_byte": 172,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/enumTagOnExports.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocParseHigherOrderFunction.ts_0_188 | // @noemit: true
// @allowjs: true
// @checkjs: true
// @strict: true
// @Filename: paren.js
/** @type {function((string), function((string)): string): string} */
var x = (s, id) => id(s)
| {
"end_byte": 188,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocParseHigherOrderFunction.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag5.ts_0_289 | // @noEmit: true
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/** @typedef {{ move(distance: number): void }} Movable */
const car = /** @satisfies {Movable & Record<string, unknown>} */ ({
start() { },
move(d) {
// d should be number
},
stop() { }
})
| {
"end_byte": 289,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag5.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocImportTypeReferenceToESModule.ts_0_187 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: ex.d.ts
export var config: {}
// @Filename: test.js
/** @param {import('./ex')} a */
function demo(a) {
a.config
}
| {
"end_byte": 187,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocImportTypeReferenceToESModule.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag15.ts_0_326 | // @declaration: true
// @emitDeclarationOnly: true
// @module: esnext,es2015
// @checkJs: true
// @allowJs: true
// @filename: 0.ts
export interface I { }
// @filename: 1.js
/** @import { I } from './0' with { type: "json" } */
/** @import * as foo from './0' with { type: "json" } */
/** @param {I} a */
function f(... | {
"end_byte": 326,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag15.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typeTagModuleExports.ts_0_121 | // @Filename: bug27327.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
/** @type {string} */
module.exports = 0;
| {
"end_byte": 121,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typeTagModuleExports.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/errorOnFunctionReturnType.ts_0_945 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: foo.js
/**
* @callback FunctionReturningPromise
* @returns {Promise<number>}
*/
/** @type {FunctionReturningPromise} */
function testPromise1() {
console.log("Nope");
}
/** @type {FunctionReturningPromise} */
async function testPromise2() {
... | {
"end_byte": 945,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/errorOnFunctionReturnType.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefCrossModule.ts_0_973 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: commonjs.d.ts
declare var module: { exports: any};
// @Filename: mod1.js
/// <reference path="./commonjs.d.ts"/>
/** @typedef {{ type: "a", x: 1 }} A */
/** @typedef {{ type: "b", y: 1 }} B */
/** @typedef {A | B} Both */
module.exports = C
function C()... | {
"end_byte": 973,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefCrossModule.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag21.ts_0_840 | // @noEmit: true
// @checkJs: true
// @allowJs: true
// @module: preserve
// @noTypesAndSymbols: true
// @Filename: node_modules/tslib/package.json
{
"name": "tslib",
"exports": {
".": {
"module": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
... | {
"end_byte": 840,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag21.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTemplateConstructorFunction2.ts_0_647 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: templateTagWithNestedTypeLiteral.js
/**
* @param {T} t
* @template T
*/
function Zet(t) {
/** @type {T} */
this.u
this.t = t
}
/**
* @param {T} v
* @param {object} o
* @param {T} o.nested
*/
Zet.prototype.add = function(v, o) {
t... | {
"end_byte": 647,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTemplateConstructorFunction2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/enumTag.ts_0_1150 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: a.js
/** @enum {string} */
const Target = {
START: "start",
MIDDLE: "middle",
END: "end",
MISTAKE: 1,
/** @type {number} */
OK_I_GUESS: 2
}
/** @enum number */
const Second = {
MISTAKE: "end",
OK: 1,
/** @type {number... | {
"end_byte": 1150,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/enumTag.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag6.ts_0_303 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /types.ts
export interface A {
a: number;
}
export interface B {
a: number;
}
// @filename: /foo.js
/**
* @import {
* A,
* B,
* } from "./types"
*/
/**
* @param { A } a
* @param { B } b
*/
function f(a, b) {}
| {
"end_byte": 303,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag6.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocAugments_notAClass.ts_0_120 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: /b.js
class A {}
/** @augments A */
function b() {}
| {
"end_byte": 120,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocAugments_notAClass.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/paramTagNestedWithoutTopLevelObject.ts_0_177 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: paramTagNestedWithoutTopLevelObject.js
/**
* @param {number} xyz.p
*/
function g(xyz) {
return xyz.p;
} | {
"end_byte": 177,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/paramTagNestedWithoutTopLevelObject.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTypeFromChainedAssignment3.ts_0_1999 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: a.js
exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = ... | {
"end_byte": 1999,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTypeFromChainedAssignment3.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocLinkTag4.ts_0_196 | // @noUnusedLocals: true
// @filename: /a.ts
export interface A {}
// @filename: /b.ts
import * as a from "./a";
/**
* @param {number} a - see {@link a.A}
*/
export function foo(a: string) {}
| {
"end_byte": 196,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocLinkTag4.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag1.ts_0_769 | // @noEmit: true
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/**
* @typedef {Object} T1
* @property {number} a
*/
/**
* @typedef {Object} T2
* @property {"a" | "b"} a
*/
/**
* @typedef {(x: string) => string} T3
*/
/**
* @typedef {Object} T4
* @property {string} a
*/
const t1 = /** @satisfi... | {
"end_byte": 769,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/parseThrowsTag.ts_0_47 | /** @throws {Error} comment */
function f() {}
| {
"end_byte": 47,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/parseThrowsTag.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/instantiateTemplateTagTypeParameterOnVariableStatement.ts_0_351 | // @checkJs: true
// @allowJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @filename: instantiateTemplateTagTypeParameterOnVariableStatement.js
/**
* @template T
* @param {T} a
* @returns {(b: T) => T}
*/
const seq = a => b => b;
const text1 = "hello";
const text2 = "world";
/** @type {string} */
... | {
"end_byte": 351,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/instantiateTemplateTagTypeParameterOnVariableStatement.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/paramTagNestedWithoutTopLevelObject2.ts_0_213 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: paramTagNestedWithoutTopLevelObject2.js
/**
* @param {object} xyz.bar
* @param {number} xyz.bar.p
*/
function g(xyz) {
return xyz.bar.p;
} | {
"end_byte": 213,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/paramTagNestedWithoutTopLevelObject2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefCrossModule2.ts_0_591 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: mod1.js
// error
/** @typedef {number} Foo */
class Foo { } // should error
/** @typedef {number} Bar */
exports.Bar = class { }
/** @typedef {number} Baz */
module.exports = {
Baz: class { }
}
// ok
/** @typedef {number} Qux */
var Qux = 2;
... | {
"end_byte": 591,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefCrossModule2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag11.ts_0_99 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /foo.js
/**
* @import foo
*/
| {
"end_byte": 99,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag11.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag13.ts_0_271 | // @noEmit: true
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/** @satisfies {{ f: (x: string) => string }} */
const t1 = { f: s => s.toLowerCase() }; // should work
/** @satisfies {{ f: (x: string) => string }} */
const t2 = { g: "oops" }; // should error
| {
"end_byte": 271,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag13.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag2.ts_0_249 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /types.ts
export interface Foo {
a: number;
}
// @filename: /foo.js
/**
* @import * as types from "./types"
*/
/**
* @param { types.Foo } foo
*/
export function f(foo) {}
| {
"end_byte": 249,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/extendsTag3.ts_0_256 | // @allowJs: true
// @checkJs: true
// @target: esnext
// @outDir: out
// @Filename: foo.js
/**
* @constructor
*/
class A {
constructor() {}
}
/**
* @extends {A}
* @constructor
*/
class B extends A {
constructor() {
super();
}
}
| {
"end_byte": 256,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/extendsTag3.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTypeReferenceToImport.ts_0_342 | // #34802
// @Filename: jsdocTypeReferenceToImport.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
const C = require('./ex').C;
const D = require('./ex')?.C;
/** @type {C} c */
var c = new C()
c.start
c.end
/** @type {D} c */
var d = new D()
d.start
d.end
// @Filename: ex.d.ts
export class C {
start: num... | {
"end_byte": 342,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTypeReferenceToImport.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/moduleExportsElementAccessAssignment2.ts_0_391 | // @noEmit: true
// @checkJs: true
// @allowJs: true
// @strict: true
// @Filename: file1.js
// this file _should_ be a global file
var GlobalThing = { x: 12 };
/**
* @param {*} type
* @param {*} ctor
* @param {*} exports
*/
function f(type, ctor, exports) {
if (typeof exports !== "undefined") {
expo... | {
"end_byte": 391,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/moduleExportsElementAccessAssignment2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/noDuplicateJsdoc1.ts_0_106 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: a.js
/** doc */
const a = b = () => 0;
| {
"end_byte": 106,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/noDuplicateJsdoc1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocImportTypeReferenceToClassAlias.ts_0_231 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: mod1.js
class C {
s() { }
}
module.exports.C = C
// @Filename: test.js
/** @typedef {import('./mod1').C} X */
/** @param {X} c */
function demo(c) {
c.s
}
| {
"end_byte": 231,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocImportTypeReferenceToClassAlias.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTemplateTagNameResolution.ts_0_238 | // @allowJs: true
// @checkJs: true
// @outDir: out
// @declaration: true
// @Filename: file.js
/**
* @template T
* @template {keyof T} K
* @typedef {T[K]} Foo
*/
const x = { a: 1 };
/** @type {Foo<typeof x, "a">} */
const y = "a"; | {
"end_byte": 238,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTemplateTagNameResolution.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTypeFromChainedAssignment2.ts_0_393 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @noImplicitAny: true
// @Filename: mod.js
/** @param {number} n */
exports.f = exports.g = function fg(n) {
return n + 1
}
/** @param {string} mom */
module.exports.h = module.exports.i = function hi(mom) {
return `hi, ${mom}!`;
}
// @Filename: use.js
va... | {
"end_byte": 393,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTypeFromChainedAssignment2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocLinkTag5.ts_0_99 | // @noUnusedLocals: true
// @filename: /a.ts
/** {@link UNRESOLVED_LINK} */
export interface A {}
| {
"end_byte": 99,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocLinkTag5.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/thisPrototypeMethodCompoundAssignmentJs.ts_0_286 | // @strict: true
// @noEmit: true
// @checkJs: true
// @allowJs: true
// @filename: index.js
Element.prototype.remove ??= function () {
this.parentNode?.removeChild(this);
};
/**
* @this Node
*/
Element.prototype.remove ??= function () {
this.parentNode?.removeChild(this);
};
| {
"end_byte": 286,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/thisPrototypeMethodCompoundAssignmentJs.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/constructorTagOnNestedBinaryExpression.ts_0_176 | // @allowjs: true
// @noemit: true
// @Filename: constructorTagOnNestedBinaryExpression.js
// Fixes #35021
/** @constructor */
a = b = function c () {
console.log(this)
};
| {
"end_byte": 176,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/constructorTagOnNestedBinaryExpression.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefScope1.ts_0_316 | // @strict: true
// @declaration: true
// @outdir: out/
// @checkJs: true
// @filename: typedefScope1.js
function B1() {
/** @typedef {number} B */
/** @type {B} */
var ok1 = 0;
}
function B2() {
/** @typedef {string} B */
/** @type {B} */
var ok2 = 'hi';
}
/** @type {B} */
var notOK = 0;
| {
"end_byte": 316,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefScope1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/paramTagNestedWithoutTopLevelObject3.ts_0_209 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: paramTagNestedWithoutTopLevelObject3.js
/**
* @param {object} xyz
* @param {number} xyz.bar.p
*/
function g(xyz) {
return xyz.bar.p;
} | {
"end_byte": 209,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/paramTagNestedWithoutTopLevelObject3.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag10.ts_0_95 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /foo.js
/**
* @import
*/
| {
"end_byte": 95,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag10.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefCrossModule3.ts_0_160 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: mod2.js
/** @typedef {number} Foo */
const ns = {};
ns.Foo = class {}
module.exports = ns;
| {
"end_byte": 160,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefCrossModule3.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocAccessibilityTagsDeclarations.ts_0_856 | // @allowJs: true
// @checkJs: true
// @target: esnext
// @outFile: foo.js
// @declaration: true
// @Filename: jsdocAccessibilityTagDeclarations.js
class Protected {
/** @protected */
constructor(c) {
/** @protected */
this.c = c
}
/** @protected */
m() {
return this.c
}
... | {
"end_byte": 856,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocAccessibilityTagsDeclarations.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag12.ts_0_675 | // @noEmit: true
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/**
* @typedef {Object} T1
* @property {number} a
*/
/**
* @typedef {Object} T2
* @property {string} a
*/
/**
* @typedef {Object} T3
* @property {"a" | "b"} a
*/
/**
* @satisfies {T1}
*/
const t1 = { a: 1 };
/**
* @satisfies {T1}
... | {
"end_byte": 675,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag12.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTypeReferenceToImportOfClassExpression.ts_0_413 | // @noEmit: true
// @allowjs: true
// @checkjs: true
// @Filename: MW.js
/** @typedef {import("./MC")} MC */
class MW {
/**
* @param {MC} compiler the compiler
*/
constructor(compiler) {
this.compiler = compiler;
}
}
module.exports = MW;
// @Filename: MC.js
const MW = require("./MW");
/** @typedef ... | {
"end_byte": 413,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTypeReferenceToImportOfClassExpression.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag3.ts_0_244 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /types.ts
export default interface Foo {
a: number;
}
// @filename: /foo.js
/**
* @import Foo from "./types"
*/
/**
* @param { Foo } foo
*/
export function f(foo) {}
| {
"end_byte": 244,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag3.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefTagTypeResolution.ts_0_467 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: github20832.js
// #20832
/** @typedef {U} T - should be "error, can't find type named 'U' */
/**
* @template U
* @param {U} x
* @return {T}
*/
function f(x) {
return x;
}
/** @type T - should be fine, since T will be any */
const x = 3;
/**
... | {
"end_byte": 467,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefTagTypeResolution.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/extendsTag2.ts_0_265 | // @allowJs: true
// @checkJs: true
// @target: esnext
// @outDir: out
// @Filename: foo.js
/**
* @constructor
*/
class A {
constructor() {}
}
/**
* @extends {A}
*/
/**
* @constructor
*/
class B extends A {
constructor() {
super();
}
}
| {
"end_byte": 265,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/extendsTag2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocTypedefOnlySourceFile.ts_0_209 | // @allowJS: true
// @suppressOutputPathCheck: true
// @filename: 0.js
// @ts-check
var exports = {};
/**
* @typedef {string}
*/
exports.SomeName;
/** @type {exports.SomeName} */
const myString = 'str';
| {
"end_byte": 209,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocTypedefOnlySourceFile.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocImportType2.ts_0_517 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: types.d.ts
declare function require(name: string): any;
declare var exports: any;
declare var module: { exports: any };
// @Filename: mod1.js
/// <reference path='./types.d.ts'/>
module.exports = class Chunk {
constructor() {
this.chunk = 1;... | {
"end_byte": 517,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocImportType2.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocLinkTag1.ts_0_158 | // @noUnusedLocals: true
// @filename: /a.ts
export interface A {}
// @filename: /b.ts
import type { A } from "./a";
/** {@link A} */
export interface B {}
| {
"end_byte": 158,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocLinkTag1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocTypeTagOnObjectProperty1.ts_0_589 | // @allowJS: true
// @suppressOutputPathCheck: true
// @strictNullChecks: true
// @filename: 0.js
// @ts-check
var lol = "hello Lol"
const obj = {
/** @type {string|undefined} */
foo: undefined,
/** @type {string|undefined} */
bar: "42",
/** @type {function(number): number} */
method1(n1) {
return n1... | {
"end_byte": 589,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocTypeTagOnObjectProperty1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocImplements_namespacedInterface.ts_0_433 | // @allowJs: true
// @checkJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @outDir: ./out
// @Filename: /defs.d.ts
declare namespace N {
interface A {
mNumber(): number;
}
interface AT<T> {
gen(): T;
}
}
// @Filename: /a.js
/** @implements N.A */
class B {
mNumber() ... | {
"end_byte": 433,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocImplements_namespacedInterface.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag4.ts_0_324 | // @noEmit: true
// @module: esnext
// @allowJS: true
// @checkJs: true
// @filename: /a.js
/**
* @typedef {Object} Foo
* @property {number} a
*/
export default /** @satisfies {Foo} */ ({});
// @filename: /b.js
/**
* @typedef {Object} Foo
* @property {number} a
*/
export default /** @satisfies {Foo} */ ({ a: 1... | {
"end_byte": 324,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocSatisfiesTag4.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/enumTagUseBeforeDefCrash.ts_0_151 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: bug27134.js
/**
* @enum {number}
*/
var foo = { };
/**
* @type {foo}
*/
var s;
| {
"end_byte": 151,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/enumTagUseBeforeDefCrash.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag14.ts_0_116 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /foo.js
/** @import * as f from "./foo" with */
| {
"end_byte": 116,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag14.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocParamOnVariableDeclaredFunctionExpression.ts_0_317 | // @allowJS: true
// @suppressOutputPathCheck: true
// @filename: 0.js
// @ts-check
/**
* @param {number=} n
* @param {string} [s]
*/
var x = function foo(n, s) {}
var y;
/**
* @param {boolean!} b
*/
y = function bar(b) {}
/**
* @param {string} s
*/
var one = function (s) { }, two = function (untyped) { };
| {
"end_byte": 317,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocParamOnVariableDeclaredFunctionExpression.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocParamTag1.ts_3_192 | @allowJS: true
// @suppressOutputPathCheck: true
// @filename: 0.js
// @ts-check
/**
* @param {number=} n
* @param {string} [s]
*/
function foo(n, s) {}
foo();
foo(1);
foo(1, "hi"); | {
"end_byte": 192,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocParamTag1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag20.ts_0_249 | // @declaration: true
// @emitDeclarationOnly: true
// @checkJs: true
// @allowJs: true
// @filename: a.ts
export interface Foo {}
// @filename: b.js
/**
* @import
* { Foo
* } from './a'
*/
/**
* @param {Foo} a
*/
export function foo(a) {}
| {
"end_byte": 249,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag20.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/importTag7.ts_0_291 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /types.ts
export interface A {
a: number;
}
export interface B {
a: number;
}
// @filename: /foo.js
/**
* @import {
* A,
* B } from "./types"
*/
/**
* @param { A } a
* @param { B } b
*/
function f(a, b) {}
| {
"end_byte": 291,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/importTag7.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typedefMultipleTypeParameters.ts_0_712 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: a.js
/**
* @template {{ a: number, b: string }} T,U A Comment
* @template {{ c: boolean }} V uh ... are comments even supported??
* @template W
* @template X That last one had no comment
* @typedef {{ t: T, u: U, v: V, w: W, x: X }} Everything
*/
... | {
"end_byte": 712,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typedefMultipleTypeParameters.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocTwoLineTypedef.ts_0_105 | // Regression from #18301
/**
* @typedef LoadCallback
* @type {function}
*/
type LoadCallback = void;
| {
"end_byte": 105,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocTwoLineTypedef.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/typeTagOnPropertyAssignment.ts_0_196 | // @noEmit: true
// @checkJs: true
// @filename: typeTagOnPropertyAssignment.js
const o = {
/**
* @type {"a"}
*/
a: "a",
/** @type {() => 'b'} */
n: () => 'b'
};
o.a
o.n
| {
"end_byte": 196,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/typeTagOnPropertyAssignment.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/thisTag1.ts_0_282 | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/** @this {{ n: number }} Mount Holyoke Preparatory School
* @param {string} s
* @return {number}
*/
function f(s) {
return this.n + s.length
}
const o = {
f,
n: 1
}
o.f('hi')
| {
"end_byte": 282,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/thisTag1.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/jsdocAugments_errorInExtendsExpression.ts_0_129 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: /a.js
class A {}
/** @augments A */
class B extends err() {}
| {
"end_byte": 129,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/jsdocAugments_errorInExtendsExpression.ts"
} |
TypeScript/tests/cases/conformance/jsdoc/checkJsdocTypeTag6.ts_0_940 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @Filename: test.js
/** @type {number} */
function f() {
return 1
}
/** @type {{ prop: string }} */
var g = function (prop) {
}
/** @type {(a: number) => number} */
function add1(a, b) { return a + b; }
/** @type {(a: number, b: number) => number} */
functi... | {
"end_byte": 940,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/jsdoc/checkJsdocTypeTag6.ts"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.