unused-class-members FP: methods called only from Svelte <template> member expressions…
- User
unused-class-members FP: methods called only from Svelte member expressions False positive on 2.84.0. Class methods called only from a Svelte
<template>via a member expression (for exampleresultState.pin(...)in markup) are reported asunused-class-member. Fallow tracks template-visible identifiers but not member-expression method calls on a bound instance inside Svelte markup.Repro (2.84.0): asciimoo/hister.
ResultState.onOpen,.pin,.updateLabel, and.addSkipRuleare each invoked from.sveltetemplates (resultState.pin(...)inResultActionsMenu.svelte) yet reported unused. The repo currently setsrules.unused-class-members: "off"to work around it.Expected: credit a method called as
<local>.<method>(...)inside a Svelte<template>when<local>resolves to an instance of the class, parallel to the existing Vue/Angular template member-access tracking.Interface
No new interfaces are introduced.
- Assistant
I’ll trace the unused-class-members analysis and the existing Svelte/Vue/Angular template bindings, then add a focused regression test and run the relevant suite.
- Assistant
rgisn’t installed in this checkout, so I’m usingfind/grepfor the same read-only discovery. - Assistant
The current tree already contains a Svelte binding-remap path, so I’m validating it against the reported shape before deciding whether the remaining gap is extraction, resolution, or test coverage.
- Assistant
The remaining real gap is Svelte 5’s instance-preserving rune wrapper:
const resultState = $state(new ResultState()). The template scanner can credit the member expression, but the script extractor currently loses the class binding at$state(...). I’m extending that binding resolution and making the fixture exercise this form. - Assistant
The focused extraction and end-to-end unused-member tests now pass with a
$state(new ResultState())-style binding. I’m running the full extractor suite and checking the diff for cache/version and formatting consistency.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.