-
-
Notifications
You must be signed in to change notification settings - Fork 40
Ignoring branches requires comments unnaturally positioned outside {…} #246
Copy link
Copy link
Open
Description
In order to mark an if or else branch as ignored, the /* v8 ignore start */…/* v8 ignore stop */ comments currently need to be positioned outside the {…}, which is awkward (especially when formatting with Prettier):
if (false /* v8 ignore start */) {
console.log("uncovered");
} /* v8 ignore stop */ else {
console.log("covered");
}
if (true) {
console.log("covered");
} /* v8 ignore start */ else {
console.log("uncovered");
} /* v8 ignore stop */It would be nicer if the else, {, and } tokens were automatically considered part of the ignored range if the statements inside are ignored, and the comments could be placed more naturally:
if (false) {
/* v8 ignore start */
console.log("uncovered");
/* v8 ignore stop */
} else {
console.log("covered");
}
if (true) {
console.log("covered");
} else {
/* v8 ignore start */
console.log("uncovered");
/* v8 ignore stop */
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels