Bug 1359604 - Enable the ESLint recommended rules for taskcluster/docker/index-task/. r?dustin draft
authorMark Banner <standard8@mozilla.com>
Tue, 25 Apr 2017 21:54:13 +0100
changeset 568180 94df7e21caac94ef83d64a53b41114f6268aa3b5
parent 568179 10ecc167ef4af98ab2659d20ec799eb765165cfd
child 625842 b15fa4f093c148ba9b203d9166c7d36b03db55f3
push id55782
push userbmo:standard8@mozilla.com
push dateTue, 25 Apr 2017 20:57:47 +0000
reviewersdustin
bugs1359604
milestone55.0a1
Bug 1359604 - Enable the ESLint recommended rules for taskcluster/docker/index-task/. r?dustin MozReview-Commit-ID: EOX2SvofSS5
taskcluster/docker/index-task/.eslintrc.js
taskcluster/docker/index-task/insert-indexes.js
new file mode 100644
--- /dev/null
+++ b/taskcluster/docker/index-task/.eslintrc.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/recommended"
+  ],
+
+  "plugins": [
+    "mozilla"
+  ],
+
+  "env": {
+    "node": true
+  }
+};
--- a/taskcluster/docker/index-task/insert-indexes.js
+++ b/taskcluster/docker/index-task/insert-indexes.js
@@ -1,47 +1,47 @@
-let taskcluster = require('taskcluster-client');
+let taskcluster = require("taskcluster-client");
 
 // Create instance of index client
 let index = new taskcluster.Index({
   delayFactor:    750,  // Good solid delay for background process
   retries:        8,    // A few extra retries for robustness
-  baseUrl:        'taskcluster/index/v1',
+  baseUrl:        "taskcluster/index/v1",
 });
 
 // Create queue instance for fetching taskId
 let queue = new taskcluster.Queue({
     delayFactor:    750,  // Good solid delay for background process
     retries:        8,    // A few extra retries for robustness
 });
 
 // Load input
 let taskId = process.env.TARGET_TASKID;
 let namespaces = process.argv.slice(2);
 
 // Validate input
 if (!taskId) {
-  console.log('Expected target task as environment variable: TARGET_TASKID');
+  console.log("Expected target task as environment variable: TARGET_TASKID");
   process.exit(1);
 }
 
 // Fetch task definition to get expiration and then insert into index
 queue.task(taskId).then(task => task.expires).then(expires => {
   return Promise.all(namespaces.map(namespace => {
-    console.log('Inserting %s into index under: %s', taskId, namespace);
+    console.log("Inserting %s into index under: %s", taskId, namespace);
     return index.insertTask(namespace, {
       taskId,
       rank: 0,
       data: {},
       expires,
     });
   }));
 }).then(() => {
-  console.log('indexing successfully completed.');
+  console.log("indexing successfully completed.");
   process.exit(0);
 }).catch(err => {
-  console.log('Error:\n%s', err);
+  console.log("Error:\n%s", err);
   if (err.stack) {
-    console.log('Stack:\n%s', err.stack);
+    console.log("Stack:\n%s", err.stack);
   }
-  console.log('Properties:\n%j', err);
+  console.log("Properties:\n%j", err);
   throw err;
 }).catch(() => process.exit(1));