0.3.1 • Published 3 years ago

ts-dedupe v0.3.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Ts-Dedupe

A cli tool to move duplicated types and interfaces to a single file.

Features

  • Moves duplicate interfaces and types to a single file
  • Renames types / interfaces with the same name but different structure
  • Organises imports in files
  • Deletes empty files
  • Creates a barrel file exporting all types in project

Options

ArgumentAliasTypeDescription
duplicatesFiledstringPath of the file where duplicate types will be moved to.
projectpstringOptional. Location of the tsconfig file for your project. Defaults to 'tsconfig.json'
retainEmptyFilesrbooleanIf specified empty files will not be removed (may cause issues if also generating a barrel file)
barrelFilebstringOptional. If specified will generate a barrel file for all the files in your project.
helphbooleanDisplays the help guide.

Programmatic Usage

import { dedupe } from "ts-dedupe"

dedupe({duplicatesFile: "shared-types.ts"})

dedupe takes an options object that matches the options for the cli as stated above. The only required property is duplicatesFile - the location to move duplicated types to.

0.3.0

3 years ago

0.3.1

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.0.0

3 years ago