Skip to content
Permalink
Browse files

Updates linter rules for var declarators

  • Loading branch information...
amuramoto committed Jan 18, 2018
1 parent 625b272 commit d36a4bb68402ea98c684e8bcf31fed8328d1801e
Showing with 26 additions and 26 deletions.
  1. +1 −1 .eslintrc.json
  2. +6 −6 client/graph-api.js
  3. +6 −6 client/index.js
  4. +4 −4 client/messages/index.js
  5. +1 −1 client/person/index.js
  6. +7 −7 webhook/index.js
  7. +1 −1 webhook/util.js
@@ -11,7 +11,7 @@
"indent": [
2,
2,
{"SwitchCase": 1}
{"SwitchCase": 1, "VariableDeclarator": {"const": 3, "let": 2}}
],
"linebreak-style": [
"error",
@@ -1,5 +1,5 @@
const request = require('request'),
fs = require('fs');
fs = require('fs');

function GraphRequest(options) {

@@ -85,11 +85,11 @@ function formatApiVersion (version) {
function sendGraphRequest (options) {

const api_version = options.api_version || this.getApiVersion(),
qs = options.qs || {},
request_options = {
uri: 'https://graph.facebook.com',
qs: qs
};
qs = options.qs || {},
request_options = {
uri: 'https://graph.facebook.com',
qs: qs
};

return new Promise((resolve, reject) => {
if (!options.path) {
@@ -1,10 +1,10 @@
const GraphRequest = require('./graph-api'),
Messages = require('./messages'),
MessengerProfile = require('./messenger-profile'),
Person = require('./person'),
MessengerCode = require('./messenger-codes'),
MessagingInsights = require('./messaging-insights'),
Attachment = require('./attachment-upload');
Messages = require('./messages'),
MessengerProfile = require('./messenger-profile'),
Person = require('./person'),
MessengerCode = require('./messenger-codes'),
MessagingInsights = require('./messaging-insights'),
Attachment = require('./attachment-upload');

/**
* Creates an instance of `Client`, used for sending requests to the Messenger Platform APIs.
@@ -1,8 +1,8 @@
const Broadcast = require('./broadcast'),
SendApi = require('./send-api'),
MessageCreative = require('./message-creative'),
CustomLabels = require('./custom-labels'),
SponsoredMessage = require('./sponsored-message');
SendApi = require('./send-api'),
MessageCreative = require('./message-creative'),
CustomLabels = require('./custom-labels'),
SponsoredMessage = require('./sponsored-message');

function Messages (GraphRequest) {
Object.assign(
@@ -1,5 +1,5 @@
const IdMatching = require('./id-matching'),
UserProfile = require('./user-profile');
UserProfile = require('./user-profile');

function Person (GraphRequest) {
Object.assign(this, new IdMatching(GraphRequest), new UserProfile(GraphRequest));
@@ -1,6 +1,6 @@
const express = require('express'),
body_parser = require('body-parser'),
util = require('./util');
body_parser = require('body-parser'),
util = require('./util');

/**
* Creates and starts a webhook that emits all received webhook events.
@@ -15,11 +15,11 @@ const express = require('express'),
*/
function Webhook (options) {
let app,
server,
port = options.port || process.env.MESSENGER_PORT || 1337,
endpoint = options.endpoint || process.env.MESSENGER_ENDPOINT || '/webhook',
app_secret = options.app_secret || process.env.MESSENGER_APP_SECRET,
verify_token = options.verify_token || process.env.MESSENGER_VERIFY_TOKEN;
server,
port = options.port || process.env.MESSENGER_PORT || 1337,
endpoint = options.endpoint || process.env.MESSENGER_ENDPOINT || '/webhook',
app_secret = options.app_secret || process.env.MESSENGER_APP_SECRET,
verify_token = options.verify_token || process.env.MESSENGER_VERIFY_TOKEN;

if (!verify_token) throw 'VERIFY_TOKEN required to create webhook!';
if (endpoint.indexOf('/') !== 0) endpoint = '/' + endpoint;
@@ -2,7 +2,7 @@ const crypto = require('crypto');

function verifyWebhook(verify_token, qs) {
const mode = qs['hub.mode'],
token = qs['hub.verify_token'];
token = qs['hub.verify_token'];

console.log('Verifying webhook...');

0 comments on commit d36a4bb

Please sign in to comment.
You can’t perform that action at this time.