Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: -p option shorthand #67

Merged
merged 3 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ For more info, run any command with the `--help` flag:
$ ts-remove-unused --help

Options:
--project <file> Path to your tsconfig.json
-p, --project <file> Path to your tsconfig.json
--skip <regexp_pattern> Specify the regexp pattern to match files that should be skipped from transforming
--include-d-ts Include .d.ts files in target for transformation
--check Check if there are any unused exports without removing them
Expand All @@ -133,12 +133,12 @@ Options:
```
<!-- prettier-ignore-end -->

#### `--project`
#### `-p`, `--project`

Specifies the `tsconfig.json` that is used to analyze your codebase. Defaults to `tsconfig.json` in your project root.

```bash
npx @line/ts-remove-unused --skip tsconfig.client.json
npx @line/ts-remove-unused --project tsconfig.client.json
```

#### `--skip`
Expand All @@ -161,7 +161,7 @@ Use `--check` to check for unused files and exports without making changes to pr
npx @line/ts-remove-unused --skip 'src/main\.ts' --check
```

#### `-r, --recursive`
#### `-r`, `--recursive`

The default behavior of the CLI is to process all files once. Some issues may not be detected if the unused code is a result of the modification of another file in the project. When this option is enabled, ts-remove-unused will recursively re-edit/re-check files that may be affected by a file edit.

Expand Down
2 changes: 1 addition & 1 deletion lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const cli = cac('ts-remove-unused');

cli
.command('', 'There are no subcommands. Simply execute ts-remove-unused')
.option('--project <file>', 'Path to your tsconfig.json')
.option('-p, --project <file>', 'Path to your tsconfig.json')
.option(
'--skip <regexp_pattern>',
'Specify the regexp pattern to match files that should be skipped from transforming',
Expand Down
Loading