Why did eslint report the wrong no-mixed-operators?

const invalidTunnelIds = result.data && result.data.invalidTunnelIds || []

this code feels normal. I don"t know why eslint reported it wrong.

Mar.20,2021

your code may be executed correctly, but eslint's suggestion is that you should be clear about your intention. It is possible that your intention is
result.data & & (result.data.invalidTunnelIds | | [])
or
(result.data & & result.data.invalidTunnelIds) | | []
but no matter which intention it is, it is recommended that you clearly mark it. Eslint is not only to ensure the correct execution of your code, but also to standardize your code


eslint checks that the code specification is irregular and does not necessarily consider the logic of the code. This rule tells you not to & & | mix
if you don't want to follow this rule, you can ignore

in the rule field of the .eslintrc.js file.
'no-mixed-operators': [0],
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31499-2bd8b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31499-2bd8b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?