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 existing Svelte/Vue/Angular template tracking, then add the narrow regression coverage and run the relevant test suite.
- Assistant
rgisn’t installed in this workspace, so I’m using targetedfind/grepsearches instead. I’ll keep the change scoped to the template-reference path. - Assistant
The current tree already handles direct
const counter = new Counter()template calls, so I’m narrowing the regression to the binding shape used by real Svelte components—especially typed props/destructuring—rather than duplicating an already-covered case. - Assistant
I found a concrete gap adjacent to the existing direct-instance support: Svelte 5’s typed
$props()destructuring does not register each destructured local as an instance target. I’m extending the same binding-resolution mechanism to that form and adding end-to-end coverage that leaves a genuinely unused method reported. - Assistant
The end-to-end regression now passes: both template-only
ResultStatecalls are credited, whileResultState.unusedremains reported. I’m running the broader extractor and SFC suites now to catch parser/binding regressions.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.