-
Hello, I was wondering how to handle JS variable with the rule GCI12. For example : var offsetWidth = 5;
var offsetLeft = 3;
test.value.style.width = `${offsetWidth}px`;
test.value.style.left = `${offsetLeft}px`; In this example variables are constant but sometimes it is compute in JS, in this case how to replace it with a style block ? Is it a false positive ? Regards. |
Beta Was this translation helpful? Give feedback.
Answered by
utarwyn
Mar 22, 2025
Replies: 1 comment 1 reply
-
Hello! Good question, I think it depends. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
utarwyn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! Good question, I think it depends.
In your use case, it should be flagged because even if there are variables, the values are constants. But it's not that easy to detect, so I prefer to only support literals and avoid false positives for now. Thank you for the feedback 👍