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
Fix invalid option warning for string properties in *-list #5933
Comments
Might have been caused by #5924? |
@edg2s Thanks for the report and for using the template. The rule expects an array: {
"rules": {
"declaration-property-value-disallowed-list": {
"/^border/": ["none"],
"/^outline/": ["none"]
}
}
} But it seems we had undocumented behaviour of accepting strings. What's the appropriate thing to do in this situation? If people are relying on this behaviour, should we make the options validator more lenient? |
We allow strings for other To be consistent, we should officially allow strings in this rule too. (It was a historical design decision mistake to allow strings in the other rules as it needlessly complicates things, but we are where we are now.) We'll need to loosen up I've labelled the issue as ready to implement. Please consider contributing if you have time. |
Sounds like a grey area, but it would be best to avoid breaking changes (even for undocumented features) in minor releases. Right now we are in position where will have to release a new version of our shared config to prevent users seeing errors while doing normal minor version updates. |
Thanks for the report. I think --- a/lib/rules/declaration-property-value-disallowed-list/index.js
+++ b/lib/rules/declaration-property-value-disallowed-list/index.js
@@ -25,7 +25,7 @@ const rule = (primary) => {
return (root, result) => {
const validOptions = validateOptions(result, ruleName, {
actual: primary,
- possible: [validateObjectWithArrayProps([isString, isRegExp])],
+ possible: [isString, isRegExp],
});
if (!validOptions) { |
Oh, sorry, I misunderstood. The change above (#5933 (comment)) doesn't work. 😓 |
I've opened PR #5934 to fix the problem (still draft). |
@edg2s Thanks again for reporting the issue. Fix released in |
Thanks! |
What steps are needed to reproduce the bug?
The config below fails in 14.5.2 (but worked in 14.5.1):
What Stylelint configuration is needed to reproduce the bug?
How did you run Stylelint?
CLI
Which version of Stylelint are you using?
14.5.2
What did you expect to happen?
No Invalid Option warning
What actually happened?
Invalid Option warning
Does the bug relate to non-standard syntax?
No response
Proposal to fix the bug
No response
The text was updated successfully, but these errors were encountered: