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 allowEmptyInput
, cache
, fix
options to configuration object
#6778
Conversation
🦋 Changeset detectedLatest commit: 52b2ad5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
d1397b6
to
cea2d4b
Compare
In #6402, it sounds like (that's not what is implemented in the code right now) |
b4313a7
to
014d5a9
Compare
I believe there is no clear order. We can improve the doc later, so this PR's change looks good. |
@mattxwang Thanks for the pull request. In this good opportunity, I'm reconsidering this feature: Should CLI flags win config files?For example, assume we have the following config file named { "cache": true } Then, should we expect the following? Note that # Cache is enabled via config file
stylelint *.css
# Cache is enabled via CLI flag
stylelint *.css --cache
# Cache is disabled via CLI flag
stylelint *.css --no-cache My answer to the question above is yes. Because people would like to turn on/off caching without editing the config file. Should we support per-file configs for properties like
|
Thanks for the quick response @ybiquitous, I think you bring up some really great points!
I agree with you here (in other words, the CLI flag takes precedence over the config file)! Just implemented the change + have added tests for each of those three cases.
This makes sense to me as well. Do you think there are other config options that fall into this category? The rest of them feel like they could be enabled/disabled per-file. If the user has set |
Basically, we should prevent per-file config props from increasing in the future (we have now
I believe erroring is best, but if hard to implement it, just documenting the limitation might be enough. |
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Apologies for the delay, got held up with some other work. I think I've addressed most of the code review comments! To clarify, when you say
Do you mean the minimal-invasive change (ex, right now - we follow the "default" behaviour", and I've added a little note in the docs)? Or, do you mean that I should explicitly add a subdirectory check? |
I think we should add some actions for the new config props in this PR, but I don't think they are needed for the existing props. |
…basis." to `allowEmptyInput`, `fix`
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.
Thanks, LGTM 👍🏼
Shall I hold off on merging this since #6795 is a patch? (also, if you think it's appropriate, I could submit a follow-up issue to explore better ways to deal with the subdirectory issue you mentioned) |
Let's merge this and include it in the next release. 👍🏼 I've commented on the reason: #6795 (comment) |
Part of (but does not close) #5142. This PR handles all the
boolean
flags (which should be relatively simple).Sorry about the CodeQL alerts - it was an approach that I tried (and chose to abandon) that I forgot to remove 😅
As well as my note below on
cache
, two quick questions:Note that I didn't
augmentConfig
forallowEmptyInput
andcache
, since we never access them through theconfig
object outside ofstandalone.js
; including them drops code coverage. That being said, maybe there's a cleaner way to use these options "downstream", and be consistent in augmenting the config?