0.1.0 • Published 3 years ago

@rubybb/ts-fix v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

This tool is to automate the application of TypeScript codefixes across your TypeScript repositories.

Download

If cloning from GitHub, after cloning, run

npm run build
npm link

ts-fix can then be used in the command line

Example Usage

ts-fix -t path/to/tsconfig.json -f nameOfCodefix ts-fix -e 4114 --write

Flags

Options:
      --help          Show help                                              [boolean]
      --version       Show version number                                    [boolean]
  -t, --tsconfig      Path to project's tsconfig
                                                 [string] [default: "./tsconfig.json"]
  -e, --errorCode     The error code(s)                         [number] [default: []]
  -f, --fixName       The name(s) of codefixe(s) to apply       [string] [default: []]
  -w, --write         Tool will only emit or overwrite files if --write is included.
                                                            [boolean] [default: false]
  -o, --outputFolder  Path of output directory                                [string]
      --verbose       Write status to console during runtime        
                                                             [boolean] [default: true]

-t path/to/tsconfig.json or --tsconfig path/to/tsconfig.json Specifies the project to use the tool on. If no arguement given, the tool will use the tsconfig in the current working directory.

-e <number> or --errorCode <number> Specifies the errors to fix. Several error codes can be specified during the same command. The easiest way to find error codes in your repository is to hover over the error in your IDE.

-f <name> or --fixName <name> Specifies the types of codefixes to use. Several names can be specified.

If both error numbers and fix names are given, then in order to be applied, a fix must be generated by a specified error and have a name that was specified.

--write Boolean for if the tool should overwrite previous code files with the codefixed code or emit any files with codefixed code. If --write not included, then the tool will print to console which files would have changed.

--verbose Boolean for print to console diagnostics that happen during runtime. Set --no-verbose to turn these messages off.