Amphtml: I hate the `no-mixed-operators` lint rule.

Created on 18 Jul 2018  路  6Comments  路  Source: ampproject/amphtml

tenor 2

infra

Most helpful comment

I only care about || and &&. We can disable every other mixed operator.

All 6 comments

@jridgewell @gmajoulet We currently have ~170 warnings for no-mixed-operators. Do you still feel this rule is useful? Are there real bugs that need to be fixed? If so, would one of you be willing to do a one-time fix during fix-it week? If not, should we remove the rule?

+100

I only care about || and &&. We can disable every other mixed operator.

false && false || true result is not obvious at all, especially in real word cases where it's method calls and not booleans

I'd be happy with @jridgewell's suggestion though

tumblr_liy7k0ttjw1qixleeo1_400

Great compromise.

2wbwmkw

With #16889, the number of warnings goes down to 40 legit cases of mixed use of && and ||. I've filed #16888 to track the fixing of these warnings.

Was this page helpful?
0 / 5 - 0 ratings