Skip to content

Fix CLI to avoid waiting for stdin without any input and avoid different outputs#7131

Merged
ybiquitous merged 3 commits intov16from
change-cli-without-any-input
Aug 14, 2023
Merged

Fix CLI to avoid waiting for stdin without any input and avoid different outputs#7131
ybiquitous merged 3 commits intov16from
change-cli-without-any-input

Conversation

@ybiquitous
Copy link
Copy Markdown
Member

Which issue, if any, is this issue related to?

Closes #3401

Is there anything in the PR that needs further explanation?

This commit changes the following:

  1. To avoid waiting for stdin without any input. For example, just running the stylelint command
    immediately exits, instead of waiting. I believe this behavior is more user-friendly.
  2. To avoid different outputs on empty files and empty stdin. This is achieved by allowing an empty
    string input ('') from stdin. See the example below:
    # code is undefined
    bin/stylelint.mjs
    
    # code is ''
    echo -n '' | bin/stylelint.mjs

See also process.stdin.isTTY.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Fix different outputs on empty files and empty stdin in CLI

3 participants