hyperframes icon indicating copy to clipboard operation
hyperframes copied to clipboard

lint: add tests for slideshow_unresolved_ref and subcomposition_root_styled_by_class

Open jrusso1020 opened this issue 1 month ago • 1 comments

Problem

These lint rules have no test that mentions their code, so a change that breaks them would go unnoticed:

Code Severity Defined at
slideshow_unresolved_ref error packages/lint/src/rules/slideshow.ts:75
subcomposition_root_styled_by_class error packages/lint/src/rules/composition.ts:1274

Tests go in packages/lint/src/rules/slideshow.test.ts and packages/lint/src/rules/composition.test.ts.

Proposed solution

Add tests to the matching *.test.ts file next to each rule, following the style of the other tests in that file. For each rule, add at least:

  • one composition that triggers the finding, asserting the code and severity, and
  • one similar composition that should not trigger it.

Read the rule's code first: the condition it checks tells you what the minimal triggering composition looks like.

Acceptance criteria

  • Each code above is asserted by at least one positive and one negative test.
  • bun run --cwd packages/lint test passes.
  • No rule behaviour changes. If writing a test shows a rule misbehaving, note it in the PR or open a separate issue rather than changing the rule in the same PR.

jrusso1020 avatar Oct 10 '26 00:10 jrusso1020

Working on this!

CoDe-ReDz avatar Oct 10 '26 02:10 CoDe-ReDz