如何修复“>>>”和“&”运算符警告的这种意外组合?

how to fix this unexpected mix of '>>>' and '&' operators warning?

我正在尝试在我的 React 应用程序中使用 Base64 编码和解码实用程序脚本。我在这条线上收到这个警告。它工作正常,但我不想要它,也不想为此警告禁用 EsLint。

你能帮我看看哪些部分需要分组吗?

  for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {
            taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;
        }

您可以遵循建议并明确 operator precedence

taBytes[nOutIdx] = (nUint24 >>> ((16 >>> nMod3) & 24)) & 255;

... 或禁用 [​​=12=] 规则。