Fix eslint .includes instead of .indexOf

RESOLVED FIXED in 6.2

Status

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: Fallen, Assigned: Fallen)

Tracking

Trunk

Details

Attachments

(1 attachment, 1 obsolete attachment)

We have some remaining eslint failures for use of indexOf. I have a patch that fixes, just need to run some tests.
Posted patch Fix - v1 (obsolete) β€” β€” Splinter Review
This should do it, I've run the test I've changed locally. lmk if you need a try run.
Attachment #8948367 - Flags: review?(makemyday)
Attachment #8948367 - Flags: review?(jorgk)
Please double check the startsWith changes. Logically it is not quite the same, but it seems to be the intent.

Comment 3

Last year
Comment on attachment 8948367 [details] [diff] [review]
Fix - v1

Looks fine (only checked the non-calendar part).
Attachment #8948367 - Flags: review?(jorgk) → review+

Comment 4

Last year
Comment on attachment 8948367 [details] [diff] [review]
Fix - v1

Review of attachment 8948367 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, looks good.

::: calendar/providers/gdata/modules/OAuth2.jsm
@@ +133,1 @@
>                          return;

Can you please change this to
if (...) {
    return;
}

I'm wondering why the linter doesn't find this (I was sure there existed a rule for that). There's another occurrence of that pattern in this file (line 159).
Attachment #8948367 - Flags: review?(makemyday) → review+
(In reply to [:MakeMyDay] from comment #4)
> I'm wondering why the linter doesn't find this (I was sure there existed a
> rule for that). There's another occurrence of that pattern in this file
> (line 159).
The gdata provider is in eslintignore, now that it is no longer in postbox compat mode we should probably remove that. This file is copy from somewhere else in the tree, and also seems to be a mess stylewise (different indents). I fixed that specific line because I grepped for indexOf, so this fix goes a bit above what is necessary to fix eslint.
Posted patch Fix - v2 β€” β€” Splinter Review
I'm leaving line 159 as is, will take care of that in a separate bug when I enable eslint for gdata.
Attachment #8948367 - Attachment is obsolete: true
Attachment #8948790 - Flags: review+
(In reply to Philipp Kewisch [:Fallen]  from comment #6)
> I'm leaving line 159 as is, will take care of that in a separate bug when I
> enable eslint for gdata.

Doing that in bug 1436199.

Comment 8

Last year
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/f49ddaee8324
Fix eslint .includes instead of .indexOf. r=MakeMyDay,jorgk
Status: ASSIGNED → RESOLVED
Closed: Last year
Keywords: checkin-needed
Resolution: --- → FIXED

Comment 9

Last year
Mostly Calendar, so I moved the bug there.
Product: Thunderbird → Calendar
Target Milestone: --- → 6.2
You need to log in before you can comment on or make changes to this bug.