Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 noUnusedVariables incorrect in TS function with callback with same argument name #3170

Closed
1 task done
ZachHaber opened this issue Sep 6, 2022 · 2 comments · Fixed by #3317
Closed
1 task done
Assignees
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Milestone

Comments

@ZachHaber
Copy link

Environment information

Rome Extension: v0.14.0
No Rome CLI installed globally or locally,

VSCode Env Info:
Version: 1.71.0 (system setup)
Commit: 784b0177c56c607789f9638da7b6bf3230d47a8c
Date: 2022-09-01T07:36:10.600Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19044
Sandboxed: No

What happened?

  1. Set up a function with 2 arguments, where the second argument is a function that takes an argument with the same name as the first argument in the original function. I.e. 1st: arg, 2nd: cb: (arg) => any
export function flattenIntoArray (
    arg,
	cb: (arg) => any
): any {
  return cb(arg);
};
  1. See unexpected error saying arg is unused

Playground link

Expected result

arg in this case shouldn't be unused, since it is passed into the callback function.

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@ZachHaber ZachHaber added the S-To triage Status: user report of a possible bug that needs to be triaged label Sep 6, 2022
@MichaReiser
Copy link
Contributor

@xunilrj would you mind taking a look at this

@github-actions
Copy link

This issue is stale because it has been open 14 days with no activity.

@ematipico ematipico added S-Bug: confirmed Status: report has been confirmed as a valid bug A-Linter Area: linter and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Sep 23, 2022
@ematipico ematipico added this to the 10.0.0 milestone Sep 23, 2022
@xunilrj xunilrj modified the milestones: 10.0.0, 0.10.0 Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants