ts-migrate icon indicating copy to clipboard operation
ts-migrate copied to clipboard

Unusabel npx ts-migrate -- reignore

Open linonetwo opened this issue 5 years ago • 5 comments

% npx ts-migrate -- reignore      
Usage: npm run ts-migrate -- <command> [options]

Commands:
  npm run ts-migrate -- init <folder>               Initialize tsconfig.json file in <folder>
  npm run ts-migrate -- init:extended <folder>      Initialize tsconfig.json file in <folder>
  npm run ts-migrate -- rename [options] <folder>   Rename files in folder from JS/JSX to TS/TSX
  npm run ts-migrate -- migrate [options] <folder>  Fix TypeScript errors, using codemods
  npm run ts-migrate -- reignore <folder>           Re-run ts-ignore on a project

Options:
  -h, --help  Show help                                                                    [boolean]

Examples:
  npm run ts-migrate -- --help                        Show help
  npm run ts-migrate -- migrate --help                Show help for the migrate command
  npm run ts-migrate -- init frontend/foo             Create tsconfig.json file at
                                                      frontend/foo/tsconfig.json
  npm run ts-migrate -- init:extended frontend/foo    Create extended from the base tsconfig.json
                                                      file at frontend/foo/tsconfig.json
  npm run ts-migrate -- rename frontend/foo           Rename files in frontend/foo from JS/JSX to
                                                      TS/TSX
  npm run ts-migrate -- rename frontend/foo --s       Rename files in frontend/foo/bar/baz from
  "bar/baz"                                           JS/JSX to TS/TSX

Must provide a command.

On "ts-migrate": "^0.1.12",

linonetwo avatar Dec 20 '20 15:12 linonetwo

I think the problem is that you're not specifying a directory. For example, if you want to run ts-migrate in the current directory, you could try:

npx ts-migrate -- reignore .

The error message could definitely be clearer though.

edsrzf avatar Dec 20 '20 19:12 edsrzf

I actually tried this:

% npx ts-migrate -- reignore ./src
Usage: npm run ts-migrate -- <command> [options]

Commands:
  npm run ts-migrate -- init <folder>               Initialize tsconfig.json file in <folder>
  npm run ts-migrate -- init:extended <folder>      Initialize tsconfig.json file in <folder>
  npm run ts-migrate -- rename [options] <folder>   Rename files in folder from JS/JSX to TS/TSX
  npm run ts-migrate -- migrate [options] <folder>  Fix TypeScript errors, using codemods
  npm run ts-migrate -- reignore <folder>           Re-run ts-ignore on a project

Options:
  -h, --help  Show help                                                                    [boolean]

Examples:
  npm run ts-migrate -- --help                        Show help
  npm run ts-migrate -- migrate --help                Show help for the migrate command
  npm run ts-migrate -- init frontend/foo             Create tsconfig.json file at
                                                      frontend/foo/tsconfig.json
  npm run ts-migrate -- init:extended frontend/foo    Create extended from the base tsconfig.json
                                                      file at frontend/foo/tsconfig.json
  npm run ts-migrate -- rename frontend/foo           Rename files in frontend/foo from JS/JSX to
                                                      TS/TSX
  npm run ts-migrate -- rename frontend/foo --s       Rename files in frontend/foo/bar/baz from
  "bar/baz"                                           JS/JSX to TS/TSX

Must provide a command.

I use npx ts-migrate-full src to solve the problem.

linonetwo avatar Dec 21 '20 03:12 linonetwo

I'm having this same issue. Passing reignore as the command does not work. From what I can tell from the help output and the README, it should.

NickHeiner avatar Jan 26 '21 20:01 NickHeiner

It worked when I omitted the --:

ts-migrate reignore dir

NickHeiner avatar Jan 26 '21 23:01 NickHeiner

Related / duplicate: https://github.com/airbnb/ts-migrate/issues/50

NickHeiner avatar Jan 26 '21 23:01 NickHeiner