fix(linters): forbid inert counts in v8 coverage-ignore comments - #45287
Open
secustor wants to merge 1 commit into
Open
fix(linters): forbid inert counts in v8 coverage-ignore comments#45287secustor wants to merge 1 commit into
secustor wants to merge 1 commit into
Conversation
Adds a custom oxlint rule renovate/v8-ignore-no-count that flags the count form '/* v8 ignore next <N> */'. The count is not honored by vitest's ast-v8-to-istanbul hint parser, which captures only the keyword (if/else/next/file); 'next' always exempts exactly the next AST node. Trailing counts therefore suggest a line range that is never applied and mislead readers. The rule is autofixable (drops the count, preserving actual behavior) and has been applied to all existing occurrences.
jamietanna
approved these changes
Aug 19, 2026
jamietanna
left a comment
Contributor
There was a problem hiding this comment.
Conflicted otherwise LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Adds a new custom oxlint rule
renovate/v8-ignore-no-countthat forbids the count form of coverage-ignore comments, e.g./* v8 ignore next 4 -- foo */.The count is not honored by the coverage provider: vitest's
ast-v8-to-istanbulhint parser captures only the keyword (if/else/next/file), sonextalways exempts exactly the next AST node, however many lines it spans. A trailing count therefore suggests a line range that is never applied and misleads readers about what is actually exempted.Details:
tools/lint/rules/v8-ignore-no-count.js, enabled aserrorin.oxlintrc.json. It is autofixable: the fixer drops the count (e.g.next 4→next), which preserves the actual keyword-only behavior, so coverage results are unchanged.lib/andtools/.v8-ignore-reason.jsthat previously documented counts as "allowed inert noise" to point to the new companion rule.docs/development/best-practices.mdadvising against counts.Context
Please select one of the following:
next Nin v8 code coverage comments #44728AI assistance disclosure
Did you use AI tools to create any part of this pull request?
The rule implementation, config wiring, and docs update were written by Claude Code (model: Claude Fable 5), which also ran the autofix over the existing occurrences. Verified via
pnpm oxlint,pnpm type-check,pnpm biome,pnpm prettier, and targeted vitest runs.Use of AI in replying to PR comments
Who answers review comments:
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: