Skip to content

fix(code-quality): stop skipped-tests-need-tracking reporting skips in strings and comments - #64

Merged
Shironex merged 2 commits into
mainfrom
fix/skipped-tests-string-comment-false-positive
Oct 3, 2026
Merged

Shironex merged 2 commits into
mainfrom
fix/skipped-tests-string-comment-false-positive

Conversation

@Shironex

@Shironex Shironex commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Closes #63

Summary

skipped-tests-need-tracking scanned each source line for the text of a skip, so it.skip( inside a string literal, a template literal or a comment was reported as a skipped test.

  • The skip is now read from the CallExpression: the .skip / .fixme modifier on it, test or describe (also through a member, test.describe.skip(), and the xit / xdescribe / xtest aliases.
  • The text lookback stays, but only for finding the tracking marker, so a marker in a comment counts as before.
  • The report sits on the callee (it.skip, xit) or the node:test option instead of the whole line from column 1. The line is unchanged.
  • The rule's local runnerName copy is replaced by the shared helper in utils/ast.

Every skip form the line scan matched is still reported. Not widened here: it.skip.each(table)(...) and it.concurrent.skip(...) were not matched before and are not matched now.

Test plan

  • New valid cases: the issue's string, template and comment probes, a block comment, a node:test probe in a string, an uncalled it.skip reference, a marker on a chain split over lines.
  • New invalid cases assert the column, plus xtest, a nested skip, test.describe.skip(, describe.skip ( and a real skip next to the same text in a string and a comment (one report).
  • The new cases fail against the old rule (8 failures) and pass against the new one.
  • The issue's repro against the built dist: string [], template [], comment [], real [ '1:1' ].
  • bun run build, bun run typecheck, bun run test (ESLint 10 and 9, all 12 packages), bun run docs:build: all green locally.

…cking

The rule scanned each source line for the text of a skip, so it reported it.skip( inside a string, a template literal and a comment. Find the skip on the CallExpression instead and keep the text lookback for the tracking marker only. The report now sits on the callee.

Closes #63
@Shironex Shironex added false positive A rule reports code it should accept pkg: code-quality @noctcore/eslint-plugin-code-quality labels Oct 3, 2026
@Shironex Shironex self-assigned this Oct 3, 2026
@Shironex
Shironex merged commit 48a3bd0 into main Oct 3, 2026
8 checks passed
@Shironex
Shironex deleted the fix/skipped-tests-string-comment-false-positive branch October 3, 2026 19:19
@github-actions github-actions Bot mentioned this pull request Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

false positive A rule reports code it should accept pkg: code-quality @noctcore/eslint-plugin-code-quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skipped-tests-need-tracking: reports .skip( inside string literals, template literals and comments

1 participant