Skip to content
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

[Suggestion] Allow @ts-ignore at the end of the same line #20111

Open
lmcarreiro opened this issue Nov 17, 2017 · 20 comments
Open

[Suggestion] Allow @ts-ignore at the end of the same line #20111

lmcarreiro opened this issue Nov 17, 2017 · 20 comments
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@lmcarreiro
Copy link

I added a comment in #18457 (comment) but I think that nobody saw it.

It would be nice if I could put the @ts-ignore at the same line, to leave the code more readable

let v1: string = 1; // @ts-ignore
let v2: string = 2; // @ts-ignore
let v3: string = 3; // @ts-ignore
let v4: string = 4; // @ts-ignore
let v5: string = 5; // @ts-ignore
let v6: string = 6; // @ts-ignore

instead of:

// @ts-ignore
let v1: string = 1;
// @ts-ignore
let v2: string = 2;
// @ts-ignore
let v3: string = 3;
// @ts-ignore
let v4: string = 4;
// @ts-ignore
let v5: string = 5;
// @ts-ignore
let v6: string = 6;
@DanielRosenwasser DanielRosenwasser added the Suggestion An idea for TypeScript label Nov 17, 2017
@weswigham weswigham added the In Discussion Not yet reached consensus label Nov 6, 2018
@mgcrea
Copy link

mgcrea commented Jul 17, 2019

Would be great, but I think having a separate syntax, eg. @ts-ignore-line would be safer as there would not be any doubt about swallowing errors for the next line.

@xamgore
Copy link

xamgore commented Nov 10, 2019

@DanielRosenwasser is it possible to include the feature into the upcoming 3.8 iteration?

@bdrazen
Copy link

bdrazen commented Dec 23, 2019

Still nothing on this...?

@satelllte
Copy link

Still nothing on this? 😢

@mckravchyk
Copy link

+1 for @ts-ignore-line

@olafkotur
Copy link

+1 for @ts-ignore-line too :)

@user72356
Copy link

+1 for this. The ever responsive MS...

@nikhil-varma
Copy link

+1 For this

@Auxtal
Copy link

Auxtal commented Mar 27, 2023

Please, how is this still open 😩

@sansantosh
Copy link

sansantosh commented May 6, 2023

work around:
You can do this instead :
image

@user72356
Copy link

work around: You can do this instead : image

That's even harder to read than having the ignore above the line.

@sansantosh
Copy link

work around: You can do this instead : image

That's even harder to read than having the ignore above the line.

but it does save extra new lines

@machineghost
Copy link

machineghost commented Jun 15, 2023

It'd be nice if the Typescript team would either accept or reject this issue, instead of leaving it in limbo.

It seems to me like this would improve TypeScript for everyone ... but if the maintainers don't agree, even a one-sentence explanation of why they feel it would be detrimental would be greatly appreciated.

@Jropp
Copy link

Jropp commented Aug 2, 2023

+1

1 similar comment
@pinkboid
Copy link

+1

@mafuuu-dev
Copy link

+1.

Such a necessary and important functionality, code cleanliness suffers because of this, it's terribly annoying when everything looks beautiful and elegant, but then this annotation appears, it stands out so much. Team, please pay attention to this issue! It's been almost 6 years already! It's really very painful.

@mgcrea @machineghost @DanielRosenwasser @weswigham @sansantosh

@dandv
Copy link
Contributor

dandv commented Jan 30, 2024

ESLint has this feature in the form of // eslint-disable-line. Would be nice for TypeScript to allow a similar syntax.

@lborgman
Copy link

lborgman commented Aug 8, 2024

Any news?

@snarbies
Copy link

snarbies commented Aug 8, 2024

Any news?

If there was, this is where it would be. Set your expectations accordingly.

@kenlane33
Copy link

+1 for @ts-ignore-line
Lack of it blocks team migration to TS.
"Require massive code junk!? Forget it!"
Choose: (A) TS adoption or (B) legibility-crime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests