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 quiet
option to Node.js API
#5542
Conversation
} | ||
|
||
if (stylelint._options.syntax) { | ||
return Promise.reject( |
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.
When throw
and error in async function it is converted to rejected Promise. So for being more explicit I converted all throw
into return Promise.reject()
through this PR.
Great! Does it make sense to add the documentation fix to this PR title? |
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.
I love it 😆
} | ||
|
||
fileList = fileList.map((entry) => { | ||
let fileList = [files].flat().map((entry) => { |
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.
[files].flat()
is a neat replacement for if (typeof fileList === 'string') {
, I haven't seen that before.
const absoluteFilepath = !path.isAbsolute(filePath) | ||
? path.join(cwd, filePath) | ||
: path.normalize(filePath); | ||
if (filePaths.length) { |
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.
This is a nice unravelling of some nested if
s.
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.
quiet
option to Node.js API
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.
LGTM! 👍🏼
And, sorry for the conflict by #5544 merged... 🙇🏼
# Conflicts: # lib/isPathIgnored.js
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.
Thank you 👍🏼
|
Related to #5529, but not closes it.
Refactored as much as possible to async-await in core. Also noticed some improvements to code.
Accidentally found that
quite
flag in Node.js API didn't work. It's probably worked only in CLI only for a long time, even thought stylelint have it since v2.0.0. This option wasn't even documented. I fixed it and added tests. UPD: found that there is an issue #4476 :)