You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportfunctionf(){consto=/** before */{/* inline post-{ */// end line post-{// document first type/* inline before */x/* inline pre-colon */ : /* inline pre-type */5/* inline post-type */,// after comma1// document second type/** 2 before */y : 'str'/** 2 after */,//after comma2// pre-closing}/** after */;returno;}
π Actual behavior
After running the autofixer, the result includes many of the inline code comments in the added type annotation. It looks like:
exportfunctionf(): {/* inline post-{ */// end line post-{// document first type/* inline before */x: number;/* inline post-type */// after comma1// document second type/** 2 before */y: string;/** 2 after */}{consto=/** before */{/* inline post-{ */// end line post-{// document first type/* inline before */x/* inline pre-colon */ : /* inline pre-type */5/* inline post-type */,// after comma1// document second type/** 2 before */y : 'str'/** 2 after */,//after comma2// pre-closing}/** after */;returno;}
π Expected behavior
The actual behavior isn't technically broken, but I would generally expect/prefer the generated annotation to include only types with no comments. Something like:
exportfunctionf(): {x: number;y: string;}{consto=/** before */{/* inline post-{ */// end line post-{// document first type/* inline before */x/* inline pre-colon */ : /* inline pre-type */5/* inline post-type */,// after comma1// document second type/** 2 before */y : 'str'/** 2 after */,//after comma2// pre-closing}/** after */;returno;}
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered:
π Search Terms
isolatedDeclarations, autofixer, quick fix, quickfixer, quick-fix, duplicate, redundant, comments
π Version & Regression Information
TS5.5+
β― Playground Link
https://www.typescriptlang.org/play/?downlevelIteration=true&importHelpers=true&target=99&module=1&isolatedDeclarations=true&ts=5.7.3#code/KYDwDg9gTgLgBAMwK4DsDGMCWEWIBQCUcA3gFBwVxo4DO8EcAvHAPQBUbcARsAtMHDYsSrTphQAbcQMh0AtMUHCWw4CgAmcKShkR5ZSpRVx1ENEgC2a+AkxQ6cGAE8wwcodFxx2gTz5QBITgQT29pODAAuWoJHCU4AC5QyXDI4DlnV3iAVmSfCL0YDJdA4QAaVmEAQwQYYCgqCAsLKoBGd0NjU3MrFHgaYGoNRxKOow44ACZuXn54p0S4AHI6KCXRTmmauoahCpVt+sbmqsmximM06NiacQBzMYBfDbhD3ZYAbjGAmCQoXAgX0eQA
π» Code
π Actual behavior
After running the autofixer, the result includes many of the inline code comments in the added type annotation. It looks like:
π Expected behavior
The actual behavior isn't technically broken, but I would generally expect/prefer the generated annotation to include only types with no comments. Something like:
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: