mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-17 11:27:46 -05:00
Component commits:956ac2132aAllowed comment directives to be multiline12749c9291Added tests, and perhaps fixed a test runner bug?99bb366fd6I think it's going to need a consistent variable to loop overa21477d6acUsed dynamically computed indexes in verifies992441d9b8Added multiline tests199d256ba2Increased flexibility for multiline comment parsing65a7587432Undid a couple of formatting changes; removed backslashes from multiline regexp036a4ae922Merge branch 'master'b620104be2Merge branch 'master' of https://github.com/microsoft/TypeScript into multiline-comment-directives Co-authored-by: Orta Therox <orta.therox@gmail.com>
This commit is contained in:
53
tests/cases/conformance/directives/multiline.tsx
Normal file
53
tests/cases/conformance/directives/multiline.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
// @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: { foo: string }) {
|
||||
return <div />;
|
||||
}
|
||||
|
||||
let x = (
|
||||
<div>
|
||||
{/*
|
||||
@ts-ignore */}
|
||||
<MyComponent foo={100} />
|
||||
|
||||
{/*@ts-ignore*/}
|
||||
<MyComponent foo={100} />
|
||||
|
||||
{/*
|
||||
@ts-expect-error */}
|
||||
<MyComponent foo={100} />
|
||||
|
||||
{/*
|
||||
// @ts-expect-error */}
|
||||
<MyComponent foo={100} />
|
||||
|
||||
{/*
|
||||
* @ts-expect-error */}
|
||||
<MyComponent foo={100} />
|
||||
|
||||
{/*@ts-expect-error*/}
|
||||
<MyComponent foo={100} />
|
||||
|
||||
{/*
|
||||
@ts-expect-error */}
|
||||
<MyComponent foo={"hooray"} />
|
||||
</div>
|
||||
);
|
||||
@@ -1,14 +1,32 @@
|
||||
// @ts-expect-error additional commenting
|
||||
var invalidCommentedFancy: number = 'nope';
|
||||
var invalidCommentedFancySingle: number = 'nope';
|
||||
|
||||
/*
|
||||
@ts-expect-error additional commenting */
|
||||
var invalidCommentedFancyMulti: number = 'nope';
|
||||
|
||||
// @ts-expect-error additional commenting
|
||||
var validCommentedFancy: string = 'nope';
|
||||
var validCommentedFancySingle: string = 'nope';
|
||||
|
||||
/* @ts-expect-error additional commenting */
|
||||
var validCommentedFancyMulti: string = 'nope';
|
||||
|
||||
// @ts-expect-error
|
||||
var invalidCommentedPlain: number = 'nope';
|
||||
var invalidCommentedPlainSingle: number = 'nope';
|
||||
|
||||
/*
|
||||
@ts-expect-error */
|
||||
var invalidCommentedPlainMulti: number = 'nope';
|
||||
|
||||
// @ts-expect-error
|
||||
var validCommentedPlain: string = 'nope';
|
||||
var validCommentedPlainSingle: string = 'nope';
|
||||
|
||||
/* @ts-expect-error */
|
||||
var validCommentedPlainMulti1: string = 'nope';
|
||||
|
||||
/*
|
||||
@ts-expect-error */
|
||||
var validCommentedPlainMulti2: string = 'nope';
|
||||
|
||||
var invalidPlain: number = 'nope';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user