microsoft / microsoft/TypeScript
Allow trailing lines in multiline comment directives
@DanielRosenwasser arbeitet bereits daran.
Seit 08.5.2020.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
TypeScript Version: 4.0.0-dev.20200507
Search Terms: multiline comment directive ts-expect-error ts-ignore
Code
const x = 0;
/* @ts-ignore
continuing comment
that could be multiline*/
x();
Expected behavior:
The comment looks like a directive to ignore the x();'s type checking complaint.
Actual behavior:
Comment directive parsing only looks at the last line of the comment. It should also allow the first line of the comment.
I'm in favor of not allowing any other lines (i.e. "middle" lines) to count as directives. Extending to allow characters after the @ts- has precedent from what's already allowed (we're really just adding newlines). But putting characters before the @ts- has a precedent of not working even in single-line comments.
/* Here we use a
@ts-ignore
that is multiline*/
Related Issues: Following discussion in https://github.com/microsoft/TypeScript/pull/38228#discussion_r420940329, as suggested by @sheetalkamat.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.