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 false positives and memory leak for function-calc-no-unspaced-operator
#6045
Conversation
@@ -32,9 +32,27 @@ testRule({ | |||
{ |
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.
[note] Testing --fix
has been done.
fix: true, |
66b83a5
to
73a702c
Compare
}, | ||
{ | ||
code: 'a { top: calc(10px/var(--foo)); }', | ||
}, |
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.
[note] The case raised a memory leak. See #6044 (comment)
sourceIndex: 0, | ||
sourceEndIndex: 1, | ||
}); | ||
currentNode.value = isBeforeOp ? `${currentNode.value} ` : ` ${currentNode.value}`; |
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.
Oh, dropping *
and /
may make the mutation unnecessary. I'll try removing it.
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've reconsidered. Test cases may not be enough. But, just in case, I leave it.
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 for fixing the memory leak @ybiquitous !
I've tweaked the README, but everything else LGTM.
Feel free to merge.
Changelog entry added:
|
function-calc-no-unspaced-operator
and--fix
#6044This pull request does 2 major things:
*
and/
operators since they are not required (see alsocalc()
notes on MDN)