Skip to content

ts-expect-error covers following two lines #38433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexeagle opened this issue May 8, 2020 · 1 comment
Closed

ts-expect-error covers following two lines #38433

alexeagle opened this issue May 8, 2020 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@alexeagle
Copy link
Contributor

I noticed that ts-expect-error is suppressing errors it shouldn't be. It seems that both of the two lines following it are suppressed.

Here is a repro which you can see with [email protected] and [email protected]

alex.eagle@ip-192-168-86-150 tsexpecterror % cat > f.ts
// @ts-expect-error
const a: number = ''
const b: string = 1
alex.eagle@ip-192-168-86-150 tsexpecterror % npx tsc f.ts
alex.eagle@ip-192-168-86-150 tsexpecterror % cat > f.ts
// @ts-expect-error
const a: number = ''

const b: string = 1
alex.eagle@ip-192-168-86-150 tsexpecterror % npx tsc f.ts
f.ts:4:7 - error TS2322: Type '1' is not assignable to type 'string'.

4 const b: string = 1
        ~


Found 1 error.

/cc @JoshuaKGoldberg

@sheetalkamat
Copy link
Member

Duplicate of #38289

@sheetalkamat sheetalkamat marked this as a duplicate of #38289 May 8, 2020
@sheetalkamat sheetalkamat added the Duplicate An existing issue was already created label May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants