Skip to main content
Module

x/deno2node/src/deps.deno.ts>SourceFile#fixUnusedIdentifiers

Compile your Deno project to run on Node.js.
Go to Latest
method SourceFile.prototype.fixUnusedIdentifiers
import { SourceFile } from "https://deno.land/x/deno2node@v1.7.1/src/deps.deno.ts";

Removes all unused declarations like interfaces, classes, enums, functions, variables, parameters, methods, properties, imports, etc. from this file.

Tip: For optimal results, sometimes this method needs to be called more than once. There could be nodes that are only referenced in unused declarations and in this case, another call will also remove them.

WARNING! This will forget all the nodes in the file! It's best to do this after you're all done with the file.

Parameters

optional
formatSettings: FormatCodeSettings
  • Format code settings.
optional
userPreferences: UserPreferences
  • User preferences for refactoring.