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

Don’t throw exception if globs or file-paths to directories are given, but none are found #29

Closed
wooorm opened this issue Sep 6, 2017 · 5 comments
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have

Comments

@wooorm
Copy link
Member

wooorm commented Sep 6, 2017

Currently there’s a “No input” error:

λ remark . -qfo
Error: No input
    at stdin (/Users/niftylettuce/Public/lad/template/node_modules/unified-engine/lib/file-set-pipeline/stdin.js:30:10)
    ...

...but as there’s actually “input”, the error is weird.

I think the exception should still be thrown if nothing is passed in.

Supersedes remarkjs/remark#294.

@OmgImAlexis
Copy link

The error should really only be thrown if this was to be used programmatically where the user can then decide what to do, when used in a cli it should really just return nothing like most other clis do.

@wooorm
Copy link
Member Author

wooorm commented Sep 22, 2017

@OmgImAlexis Hello! 👋 Welcome to the community & nice to meet you!

I think you’re misunderstanding what I’m proposing and reiterating what I meant.

For example ESLint also throws without input:

$ eslint
eslint [options] file.js [file.js] [dir]

Basic configuration:
  -c, --config path::String    Use configuration from this file or shareable config
...

...and stylelint:

$ stylelint 

  A mighty, modern CSS linter.

  Usage: stylelint [input] [options]

  Input: Files(s), glob(s), or nothing to use stdin.

...and I propose remark keeps doing so too.

@niftylettuce
Copy link

Could we please make the remark CLI behave just as other CLI's do when no input is given? xo, prettier, eslint, etc all do not throw an error when no input is given. Thank you!!

@OmgImAlexis
Copy link

Neither of those examples throw an error though and you're also comparing passing . vs no argument. They're not the same thing as shown by the error.

@wooorm
Copy link
Member Author

wooorm commented Nov 6, 2017

@niftylettuce

Could we please make the remark CLI behave just as other CLI's do when no input is given? xo, prettier, eslint, etc all do not throw an error when no input is given. Thank you!!

That’s why this issue is here and the "needs pr" label is attached 🤷‍♂️

@OmgImAlexis “They're not the same thing as shown by the error” is what this issue is solving, and what I’ve tried to explain three times now...

@wooorm wooorm closed this as completed in c2b7aee Nov 16, 2017
@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface labels Aug 10, 2019
niftylettuce pushed a commit to ladjs/lad that referenced this issue Sep 13, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

No branches or pull requests

3 participants