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
Add unix
formatter
#3524
Add unix
formatter
#3524
Conversation
Fixes #3522
lib/cli.js
Outdated
@@ -234,7 +243,7 @@ const meowOptions /*: meowOptionsType*/ = { | |||
|
|||
--formatter, -f [default: "string"] | |||
|
|||
The output formatter: "compact", "json", "string" or "verbose". | |||
The output formatter: ${formatterOptions}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid a bug such as #3521, I change to generate a formatter options text from formatters
object.
But there are no tests for help text, so I don't add test cases for this change.
Here is a partial help text related to this change, which is output in my CLI termial:
$ ./bin/stylelint.js -h | grep -C3 '\-\-formatter'
If the directory for the cache does not exist, make sure you add a trailing "/"
on *nix systems or "\" on Windows. Otherwise the path will be assumed to be a file.
--formatter, -f [default: "string"]
The output formatter: "compact", "json", "string", "unix" or "verbose".
This change may be over-engineering, so I want to hear opinions of reviewes about this change.
(I will go back to hard-coded text, if there are more oppositions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unixFormatter
needs to be added to https://github.com/stylelint/stylelint/blob/master/flow-typed/stylelint.js#L147
Thanks for a feedback! I will change also |
lib/cli.js
Outdated
.join(", ") | ||
.value() | ||
.replace(/, ([a-z"]+)$/u, " or $1"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than defining formatterOptions
multiple times (above and in lib/standalone.js
), perhaps making this a util in lib/utils
with some tests.
The above is not a blocker, but would be nice to have some tests for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it's a nice idea! I will try to change code and add tests. 💪
@ntwb Thanks for your reviewing! I fixed your review points, so please review again! |
@ntwb Have your concerns been addressed? |
@jeddy3 Yes, thanks a bunch for this @ybiquitous 😄 |
Thank you, too. 😊 |
p.s. Welcome to the @stylelint organisation @ybiquitous 🎉 |
Fixes #3522
No, it's self explanatory.