Fix ESLint 6 related issues for no-async-promise-executor and no-misleading-character-class in newtab/
Categories
(Firefox :: New Tab Page, task, P1)
Tracking
()
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:
- https://eslint.org/docs/rules/no-async-promise-executor
- https://eslint.org/docs/rules/no-misleading-character-class
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.
Reporter | ||
Comment 1•5 years ago
|
||
Note, I've just attached a ESLint 6 upgrade patch queue to bug 1551829.
Comment 2•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Hah whooops. Forgot to delete the strings helper in AboutPreferences.jsm as part of bug 1485002
Comment 4•5 years ago
|
||
Reporter | ||
Comment 5•5 years ago
|
||
Thank you for working on this Ed.
Assignee | ||
Comment 6•5 years ago
|
||
Description
•