Hello :)
This bug is similar to codegen: preserve comments between CatchClause's param and body
but with some other cases that I discovered in my codebase.
Code coverage tooling that support ignore next ignore hint need code transforms to preserve some comments, you can see all the cases that I discovered in this playground
Here is the content :
Input
function myFunction(a) {
const nullishCoalescing = a ?? /* istanbul ignore next */ [];
const ternary = a ? /* istanbul ignore next */ 'first' : 'second';
const value = a && /* istanbul ignore next */ 'otherValue';
}
const myObject = {
aFunction: /* istanbul ignore next */ () => {}
}
Expected output
function myFunction(a) {
const nullishCoalescing = a ?? /* istanbul ignore next */ [];
const ternary = a ? /* istanbul ignore next */ "first" : "second";
const value = a && /* istanbul ignore next */ "otherValue";
}
const myObject = { aFunction: /* istanbul ignore next */ () => {} };
Actual output
function myFunction(a) {
const nullishCoalescing = a ?? [];
const ternary = a ? "first" : "second";
const value = a && "otherValue";
}
const myObject = { aFunction: () => {} };
Thanks
Hello :)
This bug is similar to codegen: preserve comments between CatchClause's param and body
but with some other cases that I discovered in my codebase.
Code coverage tooling that support ignore next ignore hint need code transforms to preserve some comments, you can see all the cases that I discovered in this playground
Here is the content :
Input
Expected output
Actual output
Thanks