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

Errors out with valid --baseDir option #84

Closed
rajinder-yadav opened this issue Feb 28, 2017 · 5 comments
Closed

Errors out with valid --baseDir option #84

rajinder-yadav opened this issue Feb 28, 2017 · 5 comments
Assignees

Comments

@rajinder-yadav
Copy link

rajinder-yadav commented Feb 28, 2017

npm script, using: "format": "tsfmt -r --baseDir ./configs",

I get this usage error

tscli: dev$ npm run format

> tscli@0.1.2-alpha.3 format /home/yadav/dev/projects/tscli
> tsfmt -r --baseDir ./configs

  Usage: tsfmt [options] [--] [files...]

  Options:

    -r, --replace         replace .ts file
    --verify              checking file format
    --baseDir <path>      config file lookup from <path>
    --stdin               get formatting content from stdin
    --no-tsconfig         don't read a tsconfig.json
    --no-tslint           don't read a tslint.json
    --no-editorconfig     don't read a .editorconfig
    --no-vscode           don't read a .vscode/settings.json
    --no-tsfmt            don't read a tsfmt.json
    --useTsconfig <path>  using specified config file insteaf of tsconfig.json
    --useTslint <path>    using specified config file insteaf of tslint.json
    --useTsfmt <path>     using specified config file insteaf of tsfmt.json
    --verbose             makes output more verbose
@vvakame vvakame self-assigned this Feb 28, 2017
@vvakame
Copy link
Owner

vvakame commented Feb 28, 2017

thank you for your report.
but I can't reproduce your issue.

$ tsfmt -v
5.0.0
$ tsfmt -r --baseDir ./configs
Error: ENOENT: no such file or directory, scandir '/private/tmp/tsfmt-issue84/configs'

Could I get some reproduce code?

@rajinder-yadav
Copy link
Author

rajinder-yadav commented Feb 28, 2017

You need to create the folder and move the config file there, looks like from the error the folder doesn't exist.

Here is the step to reproduce:

Clone this project: https://github.com/rajinder-yadav/tscli

Then from the terminal type:

cd tscli
mkdir configs
mv tsconfig.json configs/
npm install

Update the script in package.json, with this:

    "format": "tsfmt -r --baseDir ./configs",

Then do npm run format.

@vvakame
Copy link
Owner

vvakame commented Feb 28, 2017

ah, I know. thanks!

vvakame added a commit that referenced this issue Feb 28, 2017
@vvakame
Copy link
Owner

vvakame commented Feb 28, 2017

just released v5.0.1.
please check it! this issue is solved my local env.

@rajinder-yadav
Copy link
Author

Awesome, thanks for the quick fix :) it's working on my end, closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants