From 456627b23eb9e6bcf319b693c79748793ff38327 Mon Sep 17 00:00:00 2001 From: AustinLeeGordon Date: Fri, 8 Feb 2019 16:50:04 -0600 Subject: [PATCH] Change prettier trailingComma config to es5 Fixes #151 Fixes #154 --- .prettierrc | 2 +- lib/client.js | 4 ++-- lib/company.js | 2 +- lib/list.js | 2 +- lib/typescript/deal.ts | 4 ++-- test/contact_properties.js | 2 +- test/contacts.js | 4 ++-- test/lists.js | 10 +++++----- test/timeline.js | 6 +++--- test/workflows.js | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.prettierrc b/.prettierrc index 0c3c01e..02b209a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,6 +2,6 @@ "singleQuote": true, "semi": false, "printWidth": 80, - "trailingComma": "all", + "trailingComma": "es5", "endOfLine": "crlf" } diff --git a/lib/client.js b/lib/client.js index a3a3f9c..0b5fb41 100644 --- a/lib/client.js +++ b/lib/client.js @@ -20,7 +20,7 @@ const EventEmitter = require('events').EventEmitter const Bottleneck = require('bottleneck') const limiter = new Bottleneck({ maxConcurrent: 9, - minTime: 1000, + minTime: 1000 / 8, }) const debug = require('debug')('hubspot:client') @@ -130,7 +130,7 @@ class Client extends EventEmitter { this.updateApiLimit(res) return res }) - .then(res => res.body), + .then(res => res.body) ) // limit the number of concurrent requests }) } diff --git a/lib/company.js b/lib/company.js index c8d5ff4..4ed73a6 100644 --- a/lib/company.js +++ b/lib/company.js @@ -85,7 +85,7 @@ class Company { addContactToCompany(data) { if (!data || !data.companyId || !data.contactVid) { return Promise.reject( - new Error('companyId and contactVid params must be provided'), + new Error('companyId and contactVid params must be provided') ) } diff --git a/lib/list.js b/lib/list.js index 380a0e9..a872eb1 100644 --- a/lib/list.js +++ b/lib/list.js @@ -69,7 +69,7 @@ class List { } if (!contactBody) { return Promise.reject( - new Error('contactBody parameter must be provided.'), + new Error('contactBody parameter must be provided.') ) } diff --git a/lib/typescript/deal.ts b/lib/typescript/deal.ts index a909a83..c0b2081 100644 --- a/lib/typescript/deal.ts +++ b/lib/typescript/deal.ts @@ -21,13 +21,13 @@ declare class Deal { associate( id: number, objectType: string, - associatedObjectId: number, + associatedObjectId: number ): RequestPromise removeAssociation( id: number, objectType: string, - associatedObjectId: number, + associatedObjectId: number ): RequestPromise properties: Properties diff --git a/test/contact_properties.js b/test/contact_properties.js index f78aaf8..d9cce35 100644 --- a/test/contact_properties.js +++ b/test/contact_properties.js @@ -183,7 +183,7 @@ describe('contacts.properties', function() { .upsert(contactPropertyProperties) .then(data => { expect(data.description).to.eq( - contactPropertyProperties.description, + contactPropertyProperties.description ) }) }) diff --git a/test/contacts.js b/test/contacts.js index 8c2e0f9..8a95d68 100644 --- a/test/contacts.js +++ b/test/contacts.js @@ -7,8 +7,8 @@ const emailsFromContacts = contacts => contacts.flatMap(contact => contact['identity-profiles'].map( profile => - profile.identities.find(identity => identity.type === 'EMAIL').value, - ), + profile.identities.find(identity => identity.type === 'EMAIL').value + ) ) describe('contacts', function() { diff --git a/test/lists.js b/test/lists.js index 7fdf1c3..d9ba964 100644 --- a/test/lists.js +++ b/test/lists.js @@ -38,7 +38,7 @@ describe('lists', function() { before(function() { if (process.env.NOCK_OFF) { return createTestList(listProperties).then( - data => (listId = data.listId), + data => (listId = data.listId) ) } }) @@ -104,7 +104,7 @@ describe('lists', function() { before(function() { if (process.env.NOCK_OFF) { return createTestList(listProperties).then( - data => (listId = data.listId), + data => (listId = data.listId) ) } }) @@ -128,7 +128,7 @@ describe('lists', function() { before(function() { if (process.env.NOCK_OFF) { return createTestList(listProperties).then( - data => (listId = data.listId), + data => (listId = data.listId) ) } }) @@ -172,7 +172,7 @@ describe('lists', function() { before(function() { if (process.env.NOCK_OFF) { return createTestList(listProperties).then( - data => (listId = data.listId), + data => (listId = data.listId) ) } }) @@ -263,7 +263,7 @@ describe('lists', function() { }) .catch(error => { expect(error.message).to.equal( - 'contactBody parameter must be provided.', + 'contactBody parameter must be provided.' ) }) }) diff --git a/test/timeline.js b/test/timeline.js index 1857ca2..430da25 100644 --- a/test/timeline.js +++ b/test/timeline.js @@ -28,7 +28,7 @@ describe('timeline', function() { name: 'NumericProperty', label: 'Numeric Property', propertyType: 'Numeric', - }, + } ) describe('createEventType', () => { @@ -145,7 +145,7 @@ describe('timeline', function() { return createEventType().then(data => { eventTypeId = data.id return createEventTypeProperty(eventTypeId).then( - data => (eventTypePropertyId = data.id), + data => (eventTypePropertyId = data.id) ) }) } @@ -161,7 +161,7 @@ describe('timeline', function() { name: 'NumericProperty', label: 'A new label', propertyType: 'Numeric', - }, + } ) .then(data => { expect(data.label).to.eq('A new label') diff --git a/test/workflows.js b/test/workflows.js index a0e67f4..1713061 100644 --- a/test/workflows.js +++ b/test/workflows.js @@ -14,7 +14,7 @@ describe('workflows', function() { const firstContact = data.contacts[0] contactId = firstContact.vid contactEmail = firstContact['identity-profiles'][0].identities.find( - obj => obj.type === 'EMAIL', + obj => obj.type === 'EMAIL' ).value }) })