Skip to content

Commit

Permalink
fix name of the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzoferre committed Sep 13, 2024
1 parent 61861a5 commit e54d315
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/techniques/statics/remove-dead-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { setChanged } from "../../utils/util.js";

export default function () {
return {
name: "remove-empty-statement",
name: "remove-dead-code",
visitor: {
"VariableDeclarator|FunctionDeclaration": {
enter(path) {
const { node, scope } = path;
const binding = scope.getBinding(node.id.name);
const { id } = node;
const { name } = id;
const binding = scope.getBinding(name);
if (!binding) return;
if (binding.constant && !binding.referenced) {
path.remove();
Expand Down

0 comments on commit e54d315

Please sign in to comment.