You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I updated ESlint and xo, as my npm test said there were some minor security issues. Most of the fixes were straightforward and result in better code like two if statements in a row being turned into one with '&&', and add one being operator++ rather than o = o + 1.
However, there are three lines that are regex replaces. The first two deal with curly quotes in the data from the device (and I'm pretty sure I caught a bug in that the if statement is triggered on the same Curley bracket twice on line 198 and might be why "26" needs a special handler), and the third deals with some sort of garbage text in the event input.
Anyhow, they all three seem to be escaped out of the older version of eslint with a comment of "eslint-disable no-useless-escape". However, that isn't working in the newer eslint as it is triggered by unicorn/better-regex.
So it looks like these regex lines are intentional, but I can't for the life of me understand why. If they need to search for the escape, they should be escaping the escape (\). If they don't, they should be simplified.
Please let me know which should be done and I'll update my fork and send a pull request for the whole shebang.
The text was updated successfully, but these errors were encountered:
I'm questioning the need to have the code that violates the check. The first pair is a regex that deals with right and left curly double quotes. (/\“/g and /\”/g, which don't need to be escaped at all according to the lint). The second is /[[]"]+/g, which is the equivalent to /[[]"]+/g and searches for [,], and ".
If it were browser code, I'd understand that there can be nuances and this might be necessary, but if possible I'd rather see the "correct" Regex and a comment explaining what and why it's doing the replace than code that may or may not work properly in the first place and in the future.
So I updated ESlint and xo, as my npm test said there were some minor security issues. Most of the fixes were straightforward and result in better code like two if statements in a row being turned into one with '&&', and add one being operator++ rather than o = o + 1.
However, there are three lines that are regex replaces. The first two deal with curly quotes in the data from the device (and I'm pretty sure I caught a bug in that the if statement is triggered on the same Curley bracket twice on line 198 and might be why "26" needs a special handler), and the third deals with some sort of garbage text in the event input.
Anyhow, they all three seem to be escaped out of the older version of eslint with a comment of "eslint-disable no-useless-escape". However, that isn't working in the newer eslint as it is triggered by unicorn/better-regex.
So it looks like these regex lines are intentional, but I can't for the life of me understand why. If they need to search for the escape, they should be escaping the escape (\). If they don't, they should be simplified.
Please let me know which should be done and I'll update my fork and send a pull request for the whole shebang.
The text was updated successfully, but these errors were encountered: