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 handling, then implement the smallest targeted fix and add regression coverage.
- Assistant
rgisn’t installed in this checkout, so I’m using focusedfind/grepsearches instead. I’m also checking the repository guidance before editing. - Assistant
The current tree already has broad Svelte instance remapping added after 2.84, including a
new Counter()regression. I found a remaining Svelte 5-shaped hole: destructured, typed$props()locals aren’t entered into that binding map, so a template’sresultState.pin(...)still cannot resolve whenresultStatecomes from an inline typed props object. I’m tightening that path and adding an end-to-end class-member regression. - Assistant
The implementation now maps typed object-pattern properties to their actual local aliases (including
resultState: state), then feeds that class target into the existing Svelte template scanner. The focused extraction and full analysis regression tests are compiling now. - Assistant
One review catch: the new assertions landed in the similarly named Vue test because both fixtures use
Counter. I’m moving them into the Svelte integration test before the final verification run.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.