tools icon indicating copy to clipboard operation
tools copied to clipboard

🐛 `noRedeclare` does not report shadowed parameters by a local variable

Open Conaclos opened this issue 2 years ago • 1 comments

Environment information

CLI:
  Version:              11.0.0-nightly.846c15e
  Color support:        true

Platform:
  CPU Architecture:     x86_64
  OS:                   linux

Environment:
  ROME_LOG_DIR:         unset
  NO_COLOR:             unset
  TERM:                 "xterm-256color"
  JS_RUNTIME_VERSION:   "v18.12.0"
  JS_RUNTIME_NAME:      "node"
  NODE_PACKAGE_MANAGER: "npm/8.19.2"

Rome Configuration:
  Status:               Loaded successfully
  Formatter disabled:   false
  Linter disabled:      false

Workspace:
  Open Documents:       0

What happened?

The following code should be reported by noRedeclare:

function f(x) { var x = 5; }

Code of Conduct

  • [X] I agree to follow Rome's Code of Conduct

Conaclos avatar Mar 10 '23 17:03 Conaclos

Note: I think it is a bug related to the determination of the scope of the bindings.

Conaclos avatar Mar 10 '23 18:03 Conaclos