file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
crates/swc_ecma_parser/tests/tsc/jsDeclarationsConstsAsNamespacesWithReferences.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @target: es6 // @declaration: true // @filename: index.js export const colors = { royalBlue: "#6400e4", }; export const brandColors = { purple: colors.royalBlue, };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsCrossfileMerge.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @lib: es6 // @outDir: ./out // @declaration: true // @filename: index.js const m = require("./exporter"); module.exports = m.default; module.exports.memberName = "thing"; // @filename: exporter.js function validate() {} export default validate;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsDefault.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index1.js export default 12; // @filename: index2.js export default function foo() { return foo; } export const x = foo; export { foo as bar }; // @filename: index3.js export default class Foo { a = /** @...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsDefaultsErr.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index1.js // merge type alias and alias (should error, see #32367) class Cls { x = 12; static y = "ok" } export default Cls; /** * @typedef {string | number} default */ // @filename: index2.js // merge t...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsDocCommentsOnConsts.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index1.js /** * const doc comment */ const x = (a) => { return ''; }; /** * function doc comment */ function b() { return 0; } module.exports = {x, b}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsEnumTag.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js /** @enum {string} */ export const Target = { START: "start", MIDDLE: "middle", END: "end", /** @type {number} */ OK_I_GUESS: 2 } /** @enum number */ export const Second = { OK: 1, ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsEnums.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js // Pretty much all of this should be an error, (since enums are forbidden in js), // but we should be able to synthesize declarations from the symbols regardless export enum A {} export enum B { Mem...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedClassExpression.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js module.exports = class Thing { /** * @param {number} p */ constructor(p) { this.t = 12 + p; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedClassExpressionAnonymous.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js module.exports = class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js module.exports = class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; } } module.exports.Sub = class { constructor() { this.instance = new module.e...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedClassExpressionShadowing.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js class A { member = new Q(); } class Q { x = 42; } module.exports = class Q { constructor() { this.x = new A(); } } module.exports.Another = Q;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedClassInstance1.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js class Foo {} module.exports = new Foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedClassInstance2.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js class Foo { static stat = 10; member = 10; } module.exports = new Foo();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedClassInstance3.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js class Foo { static stat = 10; member = 10; } module.exports = new Foo(); module.exports.additional = 20;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedConstructorFunction.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: jsDeclarationsExportAssignedConstructorFunction.js /** @constructor */ module.exports.MyClass = function() { this.x = 1 } module.exports.MyClass.prototype = { a: function() { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedConstructorFunctionWithSub.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: jsDeclarationsExportAssignedConstructorFunctionWithSub.js /** * @param {number} p */ module.exports = function (p) { this.t = 12 + p; } module.exports.Sub = function() { this.instance = new module.exports...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignedVisibility.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: obj.js module.exports = class Obj { constructor() { this.x = 12; } } // @filename: index.js const Obj = require("./obj"); class Container { constructor() { this.usage = new Obj(); }...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignmentExpressionPlusSecondary.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js const Strings = { a: "A", b: "B" }; module.exports = { thing: "ok", also: "ok", desc: { item: "ok" } }; module.exports.Strings = Strings;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportAssignmentWithKeywordName.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js var x = 12; module.exports = { extends: 'base', more: { others: ['strs'] }, x };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportDefinePropertyEmit.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js Object.defineProperty(module.exports, "a", { value: function a() {} }); Object.defineProperty(module.exports, "b", { value: function b() {} }); Object.defineProperty(module.exports.b, "cat", { value: "cat" }); /** * @p...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportDoubleAssignmentInClosure.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js // @ts-nocheck function foo() { module.exports = exports = function (o) { return (o == null) ? create(base) : defineProperties(Object(o), descriptors); }; const m = function () { // I have no i...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportForms.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: cls.js export class Foo {} // @filename: func.js export function func() {} // @filename: bar.js export * from "./cls"; // @filename: bar2.js export * from "./func"; export * from "./cls"; // @filename: baz.js i...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportSpecifierNonlocal.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js export class Thing {} export class OtherThing {} // @filename: index.js export { Thing, OtherThing as default } from "./source";
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportSubAssignments.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: cls.js const Strings = { a: "A", b: "B" }; class Foo {} module.exports = Foo; module.exports.Strings = Strings;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsExportedClassAliases.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: utils/errors.js class FancyError extends Error { constructor(status) { super(`error with status ${status}`); } } module.exports = { FancyError }; // @filename: utils/index.js // issue arises here on compilati...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionClassesCjsExportAssignment.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: timer.js /** * @param {number} timeout */ function Timer(timeout) { this.timeout = timeout; } module.exports = Timer; // @filename: hook.js /** * @typedef {(arg: import("./context")) => void} HookHandler */...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionJSDoc.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js /** * Foos a bar together using an `a` and a `b` * @param {number} a * @param {string} b */ export function foo(a, b) {} /** * Legacy - DO NOT USE */ export class Aleph { /** * Impossible ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionKeywordProp.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js function foo() {} foo.null = true; function bar() {} bar.async = true; bar.normal = false; function baz() {} baz.class = true; baz.normal = false;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionKeywordPropExhaustive.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js function foo() {} // properties foo.x = 1; foo.y = 1; // keywords foo.break = 1; foo.case = 1; foo.catch = 1; foo.class = 1; foo.const = 1; foo.continue = 1; foo.debugger = 1; foo.default = 1; foo.delete...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionLikeClasses.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js /** * @param {number} x * @param {number} y */ export function Point(x, y) { if (!(this instanceof Point)) { return new Point(x, y); } this.x = x; this.y = y; } // @filename: ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionLikeClasses2.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js /** * @param {number} len */ export function Vec(len) { /** * @type {number[]} */ this.storage = new Array(len); } Vec.prototype = { /** * @param {Vec} other */ dot...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionPrototypeStatic.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js module.exports = MyClass; function MyClass() {} MyClass.staticMethod = function() {} MyClass.prototype.method = function() {} MyClass.staticProperty = 123; /** * Callback to be invoked when test execut...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionWithDefaultAssignedMember.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js function foo() {} foo.foo = foo; foo.default = foo; module.exports = foo;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctions.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js export function a() {} export function b() {} b.cat = "cat"; export function c() {} c.Cls = class {} /** * @param {number} a * @param {number} b * @return {string} */ export function d(a, b) { return /** @type {*}...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsFunctionsCjs.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js module.exports.a = function a() {} module.exports.b = function b() {} module.exports.b.cat = "cat"; module.exports.c = function c() {} module.exports.c.Cls = class {} /** * @param {number} a * @param {number} b * @r...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsGetterSetter.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @target: es6 // @declaration: true // @filename: index.js export class A { get x() { return 12; } } export class B { /** * @param {number} _arg */ set x(_arg) { } } export class C { get x() { return 12; } ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsImportAliasExposedWithinNamespace.ts
TypeScript
// @declaration: true // @emitDeclarationOnly: true // @allowJs: true // @checkJs: true // @module: commonjs // @target: es6 // @filename: file.js /** * @namespace myTypes * @global * @type {Object<string,*>} */ const myTypes = { // SOME PROPS HERE }; /** @typedef {string|RegExp|Array<string|RegExp>} myTypes.t...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsImportAliasExposedWithinNamespaceCjs.ts
TypeScript
// @declaration: true // @emitDeclarationOnly: true // @allowJs: true // @checkJs: true // @module: commonjs // @target: es6 // @filename: file.js /** * @namespace myTypes * @global * @type {Object<string,*>} */ const myTypes = { // SOME PROPS HERE }; /** @typedef {string|RegExp|Array<string|RegExp>} myTypes.t...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsImportNamespacedType.ts
TypeScript
// @declaration: true // @emitDeclarationOnly: true // @checkJs: true // @filename: file.js import { dummy } from './mod1' /** @type {import('./mod1').Dotted.Name} - should work */ var dot2 // @filename: mod1.js /** @typedef {number} Dotted.Name */ export var dummy = 1
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsImportTypeBundled.ts
TypeScript
// @allowJs: true // @checkJs: true // @outFile: out.js // @module: amd // @declaration: true // @filename: folder/mod1.js /** * @typedef {{x: number}} Item */ /** * @type {Item}; */ const x = {x: 12}; module.exports = x; // @filename: index.js /** @type {(typeof import("./folder/mod1"))[]} */ const items = [{x: 1...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsInterfaces.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js // Pretty much all of this should be an error, (since interfaces are forbidden in js), // but we should be able to synthesize declarations from the symbols regardless export interface A {} export interf...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsJSDocRedirectedLookups.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es6 // @outDir: ./out // @declaration: true // @strict: true // @noImplicitAny: false // @filename: index.js // these are recognized as TS concepts by the checker /** @type {String} */const a = ""; /** @type {Number} */const b = 0; /** @type {Boolean} */const c = true; /...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsMissingGenerics.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: file.js /** * @param {Array} x */ function x(x) {} /** * @param {Promise} x */ function y(x) {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsMissingTypeParameters.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: file.js /** * @param {Array=} y desc */ function x(y) { } // @ts-ignore /** @param {function (Array)} func Invoked */ function y(func) { return; } /** * @return {(Array.<> | null)} list of devices */ funct...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsModuleReferenceHasEmit.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js /** * @module A */ class A {} /** * Target element * @type {module:A} */ export let el = null; export default A;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsMultipleExportFromMerge.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: items.js export const a = 1; export const b = 2; export const c = 3; // @filename: justone.js export { a, b, c } from "./items"; // @filename: two.js export { a } from "./items"; export { b, c } from "./items"; ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsNestedParams.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es6 // @outDir: ./out // @declaration: true // @filename: file.js class X { /** * Cancels the request, sending a cancellation to the other party * @param {Object} error __auto_generated__ * @param {string?} error.reason the error reason to send the c...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsOptionalTypeLiteralProps1.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: esnext // @outDir: ./out // @declaration: true // @filename: foo.js /** * foo * * @public * @param {object} opts * @param {number} opts.a * @param {number} [opts.b] * @param {number} [opts.c] * @returns {number} */ function foo({ a, b, c }) { return a + b + c...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsOptionalTypeLiteralProps2.ts
TypeScript
// @allowJs: true // @checkJs: true // @strict: true // @target: esnext // @outDir: ./out // @declaration: true // @filename: foo.js /** * foo * * @public * @param {object} opts * @param {number} opts.a * @param {number} [opts.b] * @param {number} [opts.c] * @returns {number} */ function foo({ a, b, c }) { ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsParameterTagReusesInputNodeInEmit1.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es6 // @outDir: ./out // @declaration: true // @filename: base.js class Base { constructor() {} } const BaseFactory = () => { return new Base(); }; BaseFactory.Base = Base; module.exports = BaseFactory; // @filename: file.js /** @typedef {import('./base')} Bas...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsParameterTagReusesInputNodeInEmit2.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es6 // @outDir: ./out // @declaration: true // @filename: base.js class Base { constructor() {} } const BaseFactory = () => { return new Base(); }; BaseFactory.Base = Base; module.exports = BaseFactory; // @filename: file.js /** @typedef {typeof import('./base...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsPrivateFields01.ts
TypeScript
// @target: esnext // @allowJS: true // @declaration: true // @emitDeclarationOnly: true // @filename: file.js export class C { #hello = "hello"; #world = 100; #calcHello() { return this.#hello; } get #screamingHello() { return this.#hello.toUpperCase(); } /** @param value...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsReexportAliases.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: cls.js export default class Foo {} // @filename: usage.js import {default as Fooa} from "./cls"; export const x = new Fooa(); export {default as Foob} from "./cls";
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsReexportAliasesEsModuleInterop.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @esModuleInterop: true // @filename: cls.js class Foo {} module.exports = Foo; // @filename: usage.js import {default as Fooa} from "./cls"; export const x = new Fooa(); export {default as Foob} from "./cls";
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsReexportedCjsAlias.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: lib.js /** * @param {string} a */ function bar(a) { return a + a; } class SomeClass { a() { return 1; } } module.exports = { bar, SomeClass } // @filename: main.js const { SomeClass,...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsReferenceToClassInstanceCrossFile.ts
TypeScript
// @allowJs: true // @checkJs: true // @moduleResolution: node // @declaration: true // @emitDeclarationOnly: true // @filename: rectangle.js class Rectangle { constructor() { console.log("I'm a rectangle!"); } } module.exports = { Rectangle }; // @filename: index.js const {Rectangle} = require('./rect...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsRestArgsWithThisTypeInJSDocFunction.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: bug38550.js export class Clazz { /** * @param {function(this:Object, ...*):*} functionDeclaration */ method(functionDeclaration) {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsReusesExistingNodesMappingJSDocTypes.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: /out // @lib: es6 // @declaration: true // @filename: index.js /** @type {?} */ export const a = null; /** @type {*} */ export const b = null; /** @type {string?} */ export const c = null; /** @type {string=} */ export const d = null; /** @type {string!} */ export co...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsReusesExistingTypeAnnotations.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: esnext // @strict: true // @declaration: true // @filename: index.js // @outDir: /out class С1 { /** @type {string=} */ p1 = undefined; /** @type {string | undefined} */ p2 = undefined; /** @type {?string} */ p3 = null; /** @type {string | ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsSubclassWithExplicitNoArgumentConstructor.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: /out // @lib: es6 // @declaration: true // @filename: index.js export class Super { /** * @param {string} firstArg * @param {string} secondArg */ constructor(firstArg, secondArg) { } } export class Sub extends Super { constructor() { su...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsThisTypes.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: /out // @lib: es6 // @declaration: true // @filename: index.js export class A { /** @returns {this} */ method() { return this; } } export default class Base extends A { // This method is required to reproduce #35932 verify() { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypeAliases.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js export {}; // flag file as module /** * @typedef {string | number | symbol} PropName */ /** * Callback * * @callback NumberToStringCb * @param {number} a * @returns {string} */ /** * @template T * @typedef {...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypeReassignmentFromDeclaration.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: /out // @lib: es6 // @declaration: true // @filename: /some-mod.d.ts interface Item { x: string; } declare const items: Item[]; export = items; // @filename: index.js /** @type {typeof import("/some-mod")} */ const items = []; module.exports = items;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypeReassignmentFromDeclaration2.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @lib: es6 // @declaration: true // @filename: some-mod.d.ts interface Item { x: string; } declare function getItems(): Item[]; export = getItems; // @filename: index.js const items = require("./some-mod")(); module.exports = items;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypeReferences.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: tests/cases/conformance/jsdoc/declarations/out // @declaration: true // @filename: node_modules/@types/node/index.d.ts declare module "fs" { export class Something {} } // @filename: index.js /// <reference types="node" /> const Something = require("f...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypeReferences2.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: tests/cases/conformance/jsdoc/declarations/out // @declaration: true // @filename: something.ts export const o = { a: 1, m: 1 } // @filename: index.js const{ a, m } = require("./something").o; const thing = a + m module.exports = { thing };...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypeReferences3.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: tests/cases/conformance/jsdoc/declarations/out // @declaration: true // @filename: node_modules/@types/node/index.d.ts declare module "fs" { export class Something {} } // @filename: index.js /// <reference types="node" /> const Something = require("f...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypeReferences4.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: tests/cases/conformance/jsdoc/declarations/out // @declaration: true // @filename: node_modules/@types/node/index.d.ts declare module "fs" { export class Something {} } // @filename: index.js /// <reference types="node" /> export const Something = 2; /...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefAndImportTypes.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: conn.js /** * @typedef {string | number} Whatever */ class Conn { constructor() {} item = 3; method() {} } module.exports = Conn; // @filename: usage.js /** * @typedef {import("./conn")} Conn */ class Wrap { ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefAndLatebound.ts
TypeScript
// @lib: es2017 // @allowJs: true // @checkJs: true // @noEmit: true // from #53967, based on webpack/webpack#16957 // @filename: index.js const LazySet = require("./LazySet"); /** @type {LazySet} */ const stringSet = undefined; stringSet.addAll(stringSet); // @filename: LazySet.js // Comment out this JSDoc, and no...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefDescriptionsPreserved.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @declaration: true // @filename: index.js /** * Options for Foo <------------ * @typedef {Object} FooOptions * @property {boolean} bar - Marvin K Mooney * @property {string} baz - Sylvester McMonkey McBean */ /** * Multiline * Options * for Foo <-------...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefFunction.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: esnext // @outDir: ./out // @declaration: true // @filename: foo.js /** * @typedef {{ * [id: string]: [Function, Function]; * }} ResolveRejectMap */ let id = 0 /** * @param {ResolveRejectMap} handlers * @returns {Promise<any>} */ const send = handlers => new Pr...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsTypedefPropertyAndExportAssignment.ts
TypeScript
// @allowJs: true // @checkJs: true // @outDir: ./out // @lib: es6 // @declaration: true // @filename: module.js /** @typedef {'parseHTML'|'styleLayout'} TaskGroupIds */ /** * @typedef TaskGroup * @property {TaskGroupIds} id * @property {string} label * @property {string[]} traceEventNames */ /** * @type {{[P ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsUniqueSymbolUsage.ts
TypeScript
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @lib: es2017 // @filename: a.js export const kSymbol = Symbol("my-symbol"); /** * @typedef {{[kSymbol]: true}} WithSymbol */ // @filename: b.js /** * @returns {import('./a').WithSymbol} * @param {import('./a').WithSymbol} v...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsObjectsMarkedAsOpenEnded.ts
TypeScript
// @outFile: output.js // @allowJs: true // @filename: a.js var variable = {}; variable.a = 0; class C { initializedMember = {}; constructor() { this.member = {}; this.member.a = 0; } } var obj = { property: {} }; obj.property.a = 0; var arr = [{}]; function getObj() { return {...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAccessibilityTags.ts
TypeScript
// @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...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAccessibilityTagsDeclarations.ts
TypeScript
// @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 } ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAugmentsMissingType.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /a.js class A { constructor() { this.x = 0; } } /** @augments */ class B extends A { m() { this.x } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAugments_errorInExtendsExpression.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /a.js class A {} /** @augments A */ class B extends err() {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAugments_nameMismatch.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /b.js class A {} class B {} /** @augments A */ class C extends B {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAugments_noExtends.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /b.js class A { constructor() { this.x = 0; } } /** @augments A */ class B { m() { return this.x; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAugments_notAClass.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /b.js class A {} /** @augments A */ function b() {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAugments_qualifiedName.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /a.js export class A {} // @Filename: /b.js import * as a from "./a"; /** @augments a.A */ class B {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocAugments_withTypeParameter.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: /a.d.ts declare class A<T> { x: T } // @Filename: /b.js /** @augments A<number> */ class B extends A { m() { return this.x; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocBindingInUnreachableCode.ts
TypeScript
// @allowJs: true // @noEmit: true // @checkJs: true // @Filename: bug27341.js if (false) { /** * @param {string} s */ const x = function (s) { }; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocCatchClauseWithTypeAnnotation.ts
TypeScript
// @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...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocConstructorFunctionTypeReference.ts
TypeScript
// @noEmit: true // @allowJs: true // @checkJs: true // @noImplicitAny: true // @Filename: jsdocConstructorFunctionTypeReference.js var Validator = function VFunc() { this.flags = "gim" }; Validator.prototype.num = 12 /** * @param {Validator} state */ var validateRegExpFlags = function(state) { return stat...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocFunctionType.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @noImplicitAny: true // @Filename: functions.js /** * @param {function(this: string, number): number} c is just passing on through * @return {function(this: string, number): number} */ function id1(c) { return c } var x = id1(function (n) { return this.l...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocFunction_missingReturn.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @strict: true // @Filename: /a.js /** @type {function(): number} */ function f() {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImplements_class.ts
TypeScript
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @outDir: ./out // @Filename: /a.js class A { /** @return {number} */ method() { throw new Error(); } } /** @implements {A} */ class B { method() { return 0 } } /** @implements A */ class B2 { /** @return {stri...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImplements_interface.ts
TypeScript
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @outDir: ./out // @Filename: /defs.d.ts interface A { mNumber(): number; } // @Filename: /a.js /** @implements A */ class B { mNumber() { return 0; } } /** @implements {A} */ class B2 { mNumber() { ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImplements_interface_multiple.ts
TypeScript
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @outDir: ./out // @Filename: /defs.d.ts interface Drawable { draw(): number; } interface Sizable { size(): number; } // @Filename: /a.js /** * @implements {Drawable} * @implements Sizable **/ class Square { dra...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImplements_missingType.ts
TypeScript
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @outDir: ./out // @Filename: /a.js class A { constructor() { this.x = 0; } } /** @implements */ class B { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImplements_namespacedInterface.ts
TypeScript
// @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() ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImplements_properties.ts
TypeScript
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @outDir: ./out // @Filename: /a.js class A { constructor() { this.x = 0; } } /** @implements A*/ class B {} /** @implements A*/ class B2 { x = 10 } /** @implements {A}*/ class B3 { constructor() { this.x = 10 } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImplements_signatures.ts
TypeScript
// @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 { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImportType.ts
TypeScript
// @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'/> class Chunk { constructor() { this.chunk = 1; } } module.e...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImportType2.ts
TypeScript
// @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;...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImportTypeReferenceToClassAlias.ts
TypeScript
// @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 }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsdocImportTypeReferenceToCommonjsModule.ts
TypeScript
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: ex.d.ts declare var config: { fix: boolean } export = config; // @Filename: test.js /** @param {import('./ex')} a */ function demo(a) { a.fix }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University