Bug 1382963 - Remove the require-await eslint rule from Places. r?standard8 draft
authorDan Banner <dbugs@thebanners.uk>
Mon, 07 Aug 2017 15:30:48 +0100
changeset 642042 be25001290f8e94549ea648ce2fd8d16c34eb939
parent 641632 47248637eafa9a38dade8dc3aa6c4736177c8d8d
child 724877 ae72061951f2663064c4f4666e5f1e74bcc2ac5e
push id72617
push userbmo:dbugs@thebanners.uk
push dateMon, 07 Aug 2017 14:31:43 +0000
reviewersstandard8
bugs1382963
milestone57.0a1
Bug 1382963 - Remove the require-await eslint rule from Places. r?standard8 MozReview-Commit-ID: LPWSUXQSPyH
toolkit/components/places/.eslintrc.js
toolkit/components/places/PlacesDBUtils.jsm
toolkit/components/places/tests/.eslintrc.js
deleted file mode 100644
--- a/toolkit/components/places/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
-  "rules": {
-    "require-await": "error"
-  }
-};
--- a/toolkit/components/places/PlacesDBUtils.jsm
+++ b/toolkit/components/places/PlacesDBUtils.jsm
@@ -79,17 +79,17 @@ this.PlacesDBUtils = {
    * allow us to maintain a simple, consistent API for the tasks within this object.
    *
    * @return {Promise}
    *        A promise that resolves with a Map[taskName(String) -> Object].
    *        The Object has the following properties:
    *         - succeeded: boolean
    *         - logs: an array of strings containing the messages logged by the task.
    */
-  async checkAndFixDatabase() { // eslint-disable-line require-await
+  async checkAndFixDatabase() {
     let tasks = [
       this.checkIntegrity,
       this.checkCoherence,
       this.expire,
       this.vacuum,
       this.stats,
       this._refreshUI,
     ];
@@ -99,17 +99,17 @@ this.PlacesDBUtils = {
   /**
    * Forces a full refresh of Places views.
    *
    * Note: although this function isn't actually async, we keep it async to
    * allow us to maintain a simple, consistent API for the tasks within this object.
    *
    * @returns {Array} An empty array.
    */
-  async _refreshUI() { // eslint-disable-line require-await
+  async _refreshUI() {
     // Send batch update notifications to update the UI.
     let observers = PlacesUtils.history.getObservers();
     for (let observer of observers) {
       observer.onBeginUpdateBatch();
       observer.onEndUpdateBatch();
     }
     return [];
   },
@@ -142,17 +142,17 @@ this.PlacesDBUtils = {
    *
    * Note: although this function isn't actually async, we keep it async to
    * allow us to maintain a simple, consistent API for the tasks within this object.
    *
    * @return {Promise} resolves if database is sane.
    * @resolves to an array of logs for this task.
    * @rejects if we're unable to fix corruption or unable to check status.
    */
-  async _checkIntegritySkipReindex() { // eslint-disable-line require-await
+  async _checkIntegritySkipReindex() {
     return this.checkIntegrity(true);
   },
 
   /**
    * Checks integrity and tries to fix the database through a reindex.
    *
    * @param [optional] skipReindex
    *        Whether to try to reindex database or not.
@@ -769,17 +769,17 @@ this.PlacesDBUtils = {
    *
    * Note: although this function isn't actually async, we keep it async to
    * allow us to maintain a simple, consistent API for the tasks within this object.
    *
    * @return {Promise} resolves when database is vacuumed.
    * @resolves to an array of logs for this task.
    * @rejects if we are unable to vacuum database.
    */
-  async vacuum() { // eslint-disable-line require-await
+  async vacuum() {
     let logs = [];
     let DBFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
     DBFile.append("places.sqlite");
     logs.push("Initial database size is " +
                 parseInt(DBFile.fileSize / 1024) + " KiB");
     return PlacesUtils.withConnectionWrapper(
       "PlacesDBUtils: vacuum",
       async (db) => {
@@ -801,17 +801,17 @@ this.PlacesDBUtils = {
    * Forces a full expiration on the database.
    *
    * Note: although this function isn't actually async, we keep it async to
    * allow us to maintain a simple, consistent API for the tasks within this object.
    *
    * @return {Promise} resolves when the database in cleaned up.
    * @resolves to an array of logs for this task.
    */
-  async expire() { // eslint-disable-line require-await
+  async expire() {
     let logs = [];
 
     let expiration = Cc["@mozilla.org/places/expiration;1"]
                        .getService(Ci.nsIObserver);
 
     let returnPromise = new Promise(res => {
       let observer = (subject, topic, data) => {
         Services.obs.removeObserver(observer, topic);
@@ -898,17 +898,17 @@ this.PlacesDBUtils = {
 
   /**
    * Collects telemetry data and reports it to Telemetry.
    *
    * Note: although this function isn't actually async, we keep it async to
    * allow us to maintain a simple, consistent API for the tasks within this object.
    *
    */
-  async telemetry() { // eslint-disable-line require-await
+  async telemetry() {
     // This will be populated with one integer property for each probe result,
     // using the histogram name as key.
     let probeValues = {};
 
     // The following array contains an ordered list of entries that are
     // processed to collect telemetry data.  Each entry has these properties:
     //
     //  histogram: Name of the telemetry histogram to update.
--- a/toolkit/components/places/tests/.eslintrc.js
+++ b/toolkit/components/places/tests/.eslintrc.js
@@ -1,13 +1,9 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/mochitest-test",
     "plugin:mozilla/chrome-test",
     "plugin:mozilla/xpcshell-test"
   ],
-
-  "rules": {
-    "require-await": "off"
-  }
 };