Clear and concise description of the problem
In Vitest v3 it was possible to use ignore start and ignore stop code coverage ignore hints on V8 coverage. This was possible due to usage of v8-to-istanbul. However v8-to-istanbul had really limited support for ignore hints as it doesn't operate on AST level - it did not support ignore if, ignore else or ignore next. Also v8-to-istanbul reports inaccurate coverage results which was the main reason to replace it.
Users on Vitest v3 got used to ignore start and ignore stop and have been asking its support in:
One major difference in v8-to-istanbul's ignore hint support is that it "parsed" (regex match against text file) the original source file instead of the transpiled runtime code. This made it possible to use ignore hints even when the compiler (99% of times Vue) removed comments, or placed the generated code on different line.
Note that istanbul-lib-instrument has never supported ignore start/stop in its 13 years of existence. This is just a work-around v8-to-istanbul had to come up with due to its lack of AST analysis.
Suggested solution
Add support for ignore start and ignore stop to upstream packages. These ignore hints should be parsed from the original source text file, not from the transpiled runtime code.
Alternative
Have the same conversation over and over again explaining the difference between these coverage tools.
Additional context
Support for V8 coverage:
Support for Istanbul coverage:
Validations
Clear and concise description of the problem
In Vitest v3 it was possible to use
ignore startandignore stopcode coverage ignore hints on V8 coverage. This was possible due to usage ofv8-to-istanbul. Howeverv8-to-istanbulhad really limited support for ignore hints as it doesn't operate on AST level - it did not supportignore if,ignore elseorignore next. Alsov8-to-istanbulreports inaccurate coverage results which was the main reason to replace it.Users on Vitest v3 got used to
ignore startandignore stopand have been asking its support in:One major difference in
v8-to-istanbul's ignore hint support is that it "parsed" (regex match against text file) the original source file instead of the transpiled runtime code. This made it possible to use ignore hints even when the compiler (99% of times Vue) removed comments, or placed the generated code on different line.Note that
istanbul-lib-instrumenthas never supportedignore start/stopin its 13 years of existence. This is just a work-aroundv8-to-istanbulhad to come up with due to its lack of AST analysis.Suggested solution
Add support for
ignore startandignore stopto upstream packages. These ignore hints should be parsed from the original source text file, not from the transpiled runtime code.Alternative
Have the same conversation over and over again explaining the difference between these coverage tools.
Additional context
Support for V8 coverage:
ignore startandignore stopAriPerkkio/ast-v8-to-istanbul#109Support for Istanbul coverage:
ignore startandignore stopistanbuljs/istanbuljs#835Validations