sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

Issue with the parser argument #102

Closed fcsonline closed 4 years ago

fcsonline commented 4 years ago

Hi @sheerun,

I'm trying to run prettier-standard in some typescript files, running this command:

prettier-standard "src/**/*.{ts,tsx}" --parser typescript

But I get Cannot provide patterns when --stdin is used

Checking this line https://github.com/sheerun/prettier-standard/blob/master/src/cli.js#L65 and commenting out the parser check it runs as expected.

Which is the relation between hasStdin and parser flag?

Thanks!

sheerun commented 4 years ago

--parser is meant to be used if providing code via stdin

normally parser is figured out automatically from extension, so in your case prettier-standard "src/**/*.{ts,tsx}" should be enough

fcsonline commented 4 years ago

Ok. Thanks!

I was running the command without stdin and the parser arguments + the warning message was not clear enough about what was going on.

Closing the issue.

sheerun commented 4 years ago

Yes I guess it needs to be improved, thanks :)