ISSUE DESCRIPTION unused-class-members FP: methods called only from Svelte <template>…
- User
ISSUE DESCRIPTION
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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /fallow, current file: none) bash-$
Assistant
Good,
walkis already imported. Now let's look at theModuleInfoExtractorstruct fields definition to add a new field.Assistant
Let's do the refactor. First view surrounding TSSignature import to confirm it's already imported (used oxc_ast::ast::*).
Assistant
Good, wildcard import covers it. Now let's refactor:
Assistant
Now let's replace lines 476-552 with the refactored version, extracting the TSTypeLiteral body into a shared helper function.
Assistant
Good, refactor looks correct. Let's add a blank line before
fn fixture_type_reference_name.Assistant
Now let's add
record_playwright_fixture_type_interfacenearrecord_playwright_fixture_type_alias, and hook it into the interface declaration branch.Assistant
Now hook it into the
TSInterfaceDeclarationbranch ofvisit_declaration:Assistant
Now let's add the new method right after
record_typed_binding:Assistant
Now let's hook this into
visit_variable_declaration, and add the$propsrune detection helper.Assistant
Now add the
is_svelte_props_rune_callhelper function nearplaywright_extend_base_name:Assistant
Now let's build to check for errors.
Assistant
Compiles clean. Now let's rebuild the release CLI binary and re-run the repro.
Assistant
Found it — a stale cache. Let's clear it and rerun.
Assistant
Fixed. Let's remove the debug tests I added and also test other Svelte prop patterns (Svelte 4 export let, inline literal, etc.) to make sure nothing regressed.
Assistant
Good, debug tests removed. Now let's rebuild and run the extract crate test suite plus the full core test suite.
Assistant
All extract crate tests pass. Now run the core crate tests to make sure the analysis pipeline still works.
Assistant
All 523 tests pass. Let's also run the full workspace test suite to make sure nothing else broke.
Assistant
Confirmed: this test fails even without my changes (pre-existing, environment-related — likely root user bypassing read-only permission checks). Restoring my changes now.
Assistant
Just trailing blank lines — let's remove them to keep the diff clean.
Assistant
Now only
visit_impl.rsis modified, as expected. Let's review the full diff.Assistant
Inline type literal works. Now test renamed destructure and $props() generic form:
Assistant
Renamed destructure works. Now the
$props<T>()generic call form:Assistant
Excellent, all patterns work. Now let's verify genuinely-unused members are still flagged (no over-crediting):
Assistant
Only
pinused, others correctly still flagged. Now let's test the original Svelte 4export letpattern still works (regression check) and also a plain.tsfile with interface + destructure to check no over-crediting there either.Assistant
Svelte 4 pattern still works fine. Now let's check a plain
.tsfile destructure doesn't cause over-crediting from unrelated calls (sanity check that this only credits within same-file resolution logic as expected, consistent with existing conventions):Assistant
Exactly right —
usedcredited,unusedstill flagged. No over-crediting. Now let's clean up temp directories and finalize with a full diff review.Assistant
Let's run
cargo clippyon the affected crate to check for lint issues, since the repo appears to enforce strict lints (clippy::too_many_lines,#[expect(...)], etc.).Assistant
Clean. Now let's also check formatting via
cargo fmt --checkfor the file we modified.Assistant
Let's apply formatting.
Assistant
Formatting clean now. Let's re-run tests to confirm everything still passes after formatting.
Assistant
All tests pass. Let's view the final diff once more for a clean review.
Assistant
This is a clean, focused diff. Let's do a final full build and test run to be certain everything is solid.
Assistant
Whole workspace builds cleanly.
Assistant
All test suites pass except the one pre-existing environment-dependent failure unrelated to this change. Let's do a final review of the diff and clean up any leftover temp files.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →