swc/crates/swc_ecma_parser/tests/tsc/ts-expect-error.ts
2022-02-04 17:08:38 +09:00

40 lines
1.0 KiB
TypeScript

// @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 commenting */
var validCommentedFancyMulti: string = 'nope';
// @ts-expect-error
var invalidCommentedPlainSingle: number = 'nope';
/*
@ts-expect-error */
var invalidCommentedPlainMulti: number = 'nope';
// @ts-expect-error
var validCommentedPlainSingle: string = 'nope';
/* @ts-expect-error */
var validCommentedPlainMulti1: string = 'nope';
/*
@ts-expect-error */
var validCommentedPlainMulti2: string = 'nope';
var invalidPlain: number = 'nope';
var validPlain: string = 'nope';
// @ts-expect-error
(({ a: true } as const).a === false); // <-- compiles (as expected via comment)
(({ a: true } as const).a === false); // Should error
(({ a: true } as const).a === false); // error
(({ a: true } as const).a === false); // error