Closed Bug 1564124 Opened 5 years ago Closed 5 years ago

Fix ESLint 6 related issues for no-async-promise-executor and no-misleading-character-class in newtab/

Categories

(Firefox :: New Tab Page, task, P1)

task

Tracking

()

RESOLVED FIXED
Firefox 70
Iteration:
70.1 - Jul 8 - 21
Tracking Status
firefox70 --- fixed

People

(Reporter: standard8, Assigned: Mardak)

References

Details

(Keywords: github-merged)

Attachments

(1 file)

In investigating upgrading to ESLint 6, there were some issues raised in newtab. These weren't easily to disable from the top-level, so I'm raising them before landing the upgrade.

browser/components/newtab/lib/ASRouterTargeting.jsm
  79:26  error  Promise executor functions should not be async.  no-async-promise-executor (eslint)
browser/components/newtab/lib/AboutPreferences.jsm
  137:36  error  Promise executor functions should not be async.  no-async-promise-executor (eslint)
browser/components/newtab/lib/LinksCache.jsm
  86:32  error  Promise executor functions should not be async.  no-async-promise-executor (eslint)
browser/components/newtab/lib/PersistentCache.jsm
  60:34  error  Promise executor functions should not be async.  no-async-promise-executor (eslint)
browser/components/newtab/lib/Tokenize.jsm
  32:26  error  Unexpected combined character in character class.  no-misleading-character-class (eslint)

Links to rules:

The main thing to note about the no-async-promise-executor is that it is highlighting instances where an error during await could be lost and the promise wouldn't reject. LinksCache.jsm looks most at risk of that, though we might want to consider if it is appropriate to rewrite the other functions.

For example, in ASRouterTargeting.jsm, CachedTargetingGetter.get could be simply declared as an async function.

Note, I've just attached a ESLint 6 upgrade patch queue to bug 1551829.

Bugbug thinks this bug is a task, but please change it back in case of error.

Type: defect → task
Assignee: nobody → edilee
Iteration: --- → 70.1 - Jul 8 - 21
Priority: -- → P1

Hah whooops. Forgot to delete the strings helper in AboutPreferences.jsm as part of bug 1485002

Blocks: 1485002

Thank you for working on this Ed.

Blocks: 1565293
Status: NEW → RESOLVED
Closed: 5 years ago
Keywords: github-merged
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: