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 existing Svelte template reference pipeline and the Vue/Angular member-access handling, then implement the smallest parallel fix and run focused plus broader tests.
- Assistant
rgisn’t installed in this checkout, so I’m switching tofind/grep. I’m also checking the repository guidance before editing. - Assistant
The current branch already resolves template calls for
const counter = new Counter(), so the gap is narrower than the report suggests. I’m checking Svelte’s prop declaration forms—especially exported/typed props and Svelte 5 destructured$props()—because that is where the local-to-class binding can be lost. - Assistant
The exact exported typed-prop form from the report is now covered by a focused regression test. It exercises both a method call and a method reference; I’m running it now, then I’ll verify the end-to-end unused-member result.
- Assistant
The exported typed-prop case passes. I also found one real ordering hole in the same path: SFC template bindings were copied before deferred factory/alias bindings were finalized. I’m closing that so any script local that resolves to a class instance—including static factory results—is available to the Svelte template scan.
- Assistant
The focused extraction cases and end-to-end unused-class-member integration now pass. I’m doing the full extraction-crate sweep to catch any ordering regressions from finalizing deferred bindings earlier.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.