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 TypeError for spaceless condition in media-feature-name-value-allowed-list #5581
Conversation
@ybiquitous @jeddy3 is this really as simple of a change that needs to happen here? Is there a test that can cover this? |
@lachieh you could use an example from the issue and add it to the tests for the rule. |
As @hudochenkov suggested, it would be helpful to have a test case. 😃 In addition, it would be helpful if you would improve our custom type for - nodes: Child[];
+ nodes?: Child[];
|
Thank you, both. Test case will go in the |
@lachieh Yes! |
@lachieh Thanks for the pull request. If you haven't already seen it, there are steps in the CONTRIBUTING guide to run the test runner on just a particular rule. Once you've added a test case (and made @ybiquitous suggested change), we can trigger the workflow for you. |
The definition has been updated and the test case added. Thanks! |
@lachieh there is TypeScript error in some other rule, because types were changed. Could you fix it? Otherwise we can help to fix it. |
@hudochenkov surely can! I'll be back at my desk in about 24 hours. |
Oh, my suggested type change occurred the type error on It seem OK to fall back to // extract media queries if any
- const media = mediaParser(valueParser.stringify(restParams))
- .nodes.map((n) => n.value.replace(/\s/g, ''))
+ const media = (mediaParser(valueParser.stringify(restParams)).nodes || [])
+ .map((n) => n.value.replace(/\s/g, ''))
.filter((n) => n.length); |
All done! Thanks everyone! |
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.
@lachieh Thanks! LGTM 😄
LGTM, thanks! v14 changelog entry added:
|
Closes #5577
Following the discussion in the issue, this code implements the changes requested there.