-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 3.0.0-dev.20180621
Search Terms: ts-ignore
Code
<>
// @ts-ignore
{nonExistent}
</>;
`
// @ts-ignore
${nonExistent}
`;
"\
// @ts-ignore"
nonExistent;
/**
// @ts-ignore all the things */
nonExistent;
Expected behavior:
3 times Cannot find name 'nonExistent'.
Actual behavior:
No error, because the regex used to lookup the comment doesn't (and cannot reliably) check the surroundings of the comment.
To fix this, you probably need to use getTokenAtPosition
and get(Leading|Trailing)CommentRanges
to check if this is really a comment.
Related Issues:
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug