Skip to content

minifier: remove assignment to unread variable #11470

@sapphi-red

Description

@sapphi-red
let foo = {}
export function _setFoo(bar) {
  console.log('foo')
  foo = bar
}

can be replaced with

let foo = {}
export function _setFoo(bar) {
  console.log('foo')
}

because foo is not read by anything.
playground

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions