Skip to content

Commit 35799b6

Browse files
author
Nathan Houle
committed
Merge pull request #644 from segmentio/chore/lint-compliance
ESLint: space-before-blocks compliance
2 parents 0b5529f + 6094cf0 commit 35799b6

File tree

174 files changed

+2963
-2957
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+2963
-2957
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var plugins = require('./integrations.js');
1010
* Expose the integrations, using their own `name` from their `prototype`.
1111
*/
1212

13-
each(plugins, function(plugin){
13+
each(plugins, function(plugin) {
1414
var name = (plugin.Integration || plugin).prototype.name;
1515
exports[name] = plugin;
1616
});

lib/adroll/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var AdRoll = module.exports = integration('AdRoll')
3636
* @api public
3737
*/
3838

39-
AdRoll.prototype.initialize = function(){
39+
AdRoll.prototype.initialize = function() {
4040
window.adroll_adv_id = this.options.advId;
4141
window.adroll_pix_id = this.options.pixId;
4242
window.__adroll_loaded = true;
@@ -51,7 +51,7 @@ AdRoll.prototype.initialize = function(){
5151
* @return {boolean}
5252
*/
5353

54-
AdRoll.prototype.loaded = function(){
54+
AdRoll.prototype.loaded = function() {
5555
return !!window.__adroll;
5656
};
5757

@@ -64,7 +64,7 @@ AdRoll.prototype.loaded = function(){
6464
* @param {Page} page
6565
*/
6666

67-
AdRoll.prototype.page = function(page){
67+
AdRoll.prototype.page = function(page) {
6868
var name = page.fullName();
6969
this.track(page.track(name));
7070
};
@@ -76,7 +76,7 @@ AdRoll.prototype.page = function(page){
7676
* @param {Track} track
7777
*/
7878

79-
AdRoll.prototype.track = function(track){
79+
AdRoll.prototype.track = function(track) {
8080
var event = track.event();
8181
var user = this.analytics.user();
8282
var events = this.events(event);
@@ -99,7 +99,7 @@ AdRoll.prototype.track = function(track){
9999
del(customProps, 'sku');
100100
if (!is.empty(customProps)) data.adroll_custom_data = customProps;
101101

102-
each(events, function(event){
102+
each(events, function(event) {
103103
// the adroll interface only allows for
104104
// segment names which are snake cased.
105105
data.adroll_segments = snake(event);

lib/adroll/test.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ var tester = require('analytics.js-integration-tester');
55
var sandbox = require('clear-env');
66
var AdRoll = require('./');
77

8-
describe('AdRoll', function(){
8+
describe('AdRoll', function() {
99
var adroll;
1010
var analytics;
1111
var options = {
1212
advId: 'FSQJWMMZ2NEAZH6XWKVCNO',
1313
pixId: 'N6HGWT4ALRDRXCAO5PLTB6'
1414
};
1515

16-
beforeEach(function(){
16+
beforeEach(function() {
1717
analytics = new Analytics();
1818
adroll = new AdRoll(options);
1919
analytics.use(AdRoll);
2020
analytics.use(tester);
2121
analytics.add(adroll);
2222
});
2323

24-
afterEach(function(){
24+
afterEach(function() {
2525
analytics.restore();
2626
analytics.reset();
2727
adroll.reset();
2828
sandbox();
2929
});
3030

31-
it('should have the right settings', function(){
31+
it('should have the right settings', function() {
3232
analytics.compare(AdRoll, integration('AdRoll')
3333
.assumesPageview()
3434
.global('__adroll')
@@ -41,41 +41,41 @@ describe('AdRoll', function(){
4141
.mapping('events'));
4242
});
4343

44-
describe('before loading', function(){
45-
beforeEach(function(){
44+
describe('before loading', function() {
45+
beforeEach(function() {
4646
analytics.stub(adroll, 'load');
4747
});
4848

49-
afterEach(function(){
49+
afterEach(function() {
5050
adroll.reset();
5151
});
5252

53-
describe('#initialize', function(){
54-
it('should initialize the adroll variables', function(){
53+
describe('#initialize', function() {
54+
it('should initialize the adroll variables', function() {
5555
analytics.initialize();
5656
analytics.page();
5757
analytics.equal(window.adroll_adv_id, options.advId);
5858
analytics.equal(window.adroll_pix_id, options.pixId);
5959
});
6060

61-
it('should set window.__adroll_loaded', function(){
61+
it('should set window.__adroll_loaded', function() {
6262
analytics.initialize();
6363
analytics.page();
6464
analytics.assert(window.__adroll_loaded);
6565
});
6666

67-
it('should call #load', function(){
67+
it('should call #load', function() {
6868
analytics.initialize();
6969
analytics.page();
7070
analytics.called(adroll.load);
7171
});
7272

73-
describe('with user', function(){
74-
beforeEach(function(){
73+
describe('with user', function() {
74+
beforeEach(function() {
7575
analytics.user().identify('id');
7676
});
7777

78-
it('should not set a user id', function(){
78+
it('should not set a user id', function() {
7979
analytics.initialize();
8080
analytics.page();
8181
analytics.assert(!window.adroll_custom_data);
@@ -84,25 +84,25 @@ describe('AdRoll', function(){
8484
});
8585
});
8686

87-
describe('loading', function(){
88-
it('should load', function(done){
87+
describe('loading', function() {
88+
it('should load', function(done) {
8989
analytics.load(adroll, done);
9090
});
9191
});
9292

93-
describe('after loading', function(){
94-
beforeEach(function(done){
93+
describe('after loading', function() {
94+
beforeEach(function(done) {
9595
analytics.once('ready', done);
9696
analytics.initialize();
9797
analytics.page();
9898
});
9999

100-
describe('#page', function(){
101-
beforeEach(function(){
100+
describe('#page', function() {
101+
beforeEach(function() {
102102
analytics.stub(window.__adroll, 'record_user');
103103
});
104104

105-
it('should track page view with fullName', function(){
105+
it('should track page view with fullName', function() {
106106
analytics.page('Category', 'Name', { url: 'http://localhost:34448/test/' });
107107
analytics.called(window.__adroll.record_user, {
108108
adroll_segments: 'viewed_category_name_page',
@@ -118,7 +118,7 @@ describe('AdRoll', function(){
118118
});
119119
});
120120

121-
it('should track unnamed/categorized page', function(){
121+
it('should track unnamed/categorized page', function() {
122122
analytics.page({ url: 'http://localhost:34448/test/' });
123123
analytics.called(window.__adroll.record_user, {
124124
adroll_segments: 'loaded_a_page',
@@ -132,7 +132,7 @@ describe('AdRoll', function(){
132132
});
133133
});
134134

135-
it('should track unnamed page', function(){
135+
it('should track unnamed page', function() {
136136
analytics.page('Name', { url: 'http://localhost:34448/test/' });
137137
analytics.called(window.__adroll.record_user, {
138138
adroll_segments: 'viewed_name_page',
@@ -147,7 +147,7 @@ describe('AdRoll', function(){
147147
});
148148
});
149149

150-
it('should track uncategorized page', function(){
150+
it('should track uncategorized page', function() {
151151
analytics.page('Name', { url: 'http://localhost:34448/test/' });
152152
analytics.called(window.__adroll.record_user, {
153153
adroll_segments: 'viewed_name_page',
@@ -163,27 +163,27 @@ describe('AdRoll', function(){
163163
});
164164
});
165165

166-
describe('#track', function(){
167-
beforeEach(function(){
166+
describe('#track', function() {
167+
beforeEach(function() {
168168
analytics.stub(window.__adroll, 'record_user');
169169
});
170170

171-
it('should snake case event name', function(){
171+
it('should snake case event name', function() {
172172
analytics.track('Event A');
173173
analytics.called(window.__adroll.record_user, {
174174
adroll_segments: 'event_a'
175175
});
176176
});
177177

178-
describe('event not in events', function(){
179-
it('should send events with only adroll_segments', function(){
178+
describe('event not in events', function() {
179+
it('should send events with only adroll_segments', function() {
180180
analytics.track('event', {});
181181
analytics.called(window.__adroll.record_user, {
182182
adroll_segments: 'event'
183183
});
184184
});
185185

186-
it('should send events with revenue and order id', function(){
186+
it('should send events with revenue and order id', function() {
187187
analytics.track('event', { revenue: 3.99, order_id: 1 });
188188
analytics.called(window.__adroll.record_user, {
189189
adroll_segments: 'event',
@@ -192,7 +192,7 @@ describe('AdRoll', function(){
192192
});
193193
});
194194

195-
it('should pass user id in', function(){
195+
it('should pass user id in', function() {
196196
analytics.user().identify('id');
197197
analytics.track('event', { revenue: 3.99 });
198198
analytics.called(window.__adroll.record_user, {
@@ -203,12 +203,12 @@ describe('AdRoll', function(){
203203
});
204204
});
205205

206-
describe('event in events', function(){
207-
beforeEach(function(){
206+
describe('event in events', function() {
207+
beforeEach(function() {
208208
adroll.options.events = { event: 'segment' };
209209
});
210210

211-
it('should pass in revenue and order id', function(){
211+
it('should pass in revenue and order id', function() {
212212
analytics.track('event', { total: 1.99, orderId: 1 });
213213
analytics.called(window.__adroll.record_user, {
214214
adroll_segments: 'segment',
@@ -217,15 +217,15 @@ describe('AdRoll', function(){
217217
});
218218
});
219219

220-
it('should pass .revenue as conversion value', function(){
220+
it('should pass .revenue as conversion value', function() {
221221
analytics.track('event', { revenue: 2.99 });
222222
analytics.called(window.__adroll.record_user, {
223223
adroll_segments: 'segment',
224224
adroll_conversion_value_in_dollars: 2.99
225225
});
226226
});
227227

228-
it('should include the user_id when available', function(){
228+
it('should include the user_id when available', function() {
229229
analytics.user().identify('id');
230230
analytics.track('event', { revenue: 3.99 });
231231
analytics.called(window.__adroll.record_user, {
@@ -235,7 +235,7 @@ describe('AdRoll', function(){
235235
});
236236
});
237237

238-
it('should pass custom data like product id and sku', function(){
238+
it('should pass custom data like product id and sku', function() {
239239
analytics.track('event', { revenue: 2.99, id: '12345', sku: '43434-21', other: '1234' });
240240
analytics.called(window.__adroll.record_user, {
241241
adroll_segments: 'segment',
@@ -247,7 +247,7 @@ describe('AdRoll', function(){
247247
});
248248
});
249249

250-
it('should support array events', function(){
250+
it('should support array events', function() {
251251
adroll.options.events = [{ key: 'event', value: 'pixel' }];
252252
analytics.track('event', { total: 2.99, orderId: 2 });
253253
analytics.called(window.__adroll.record_user, {
@@ -257,7 +257,7 @@ describe('AdRoll', function(){
257257
});
258258
});
259259

260-
it('should track multiple events', function(){
260+
it('should track multiple events', function() {
261261
adroll.options.events = [{ key: 'event', value: 'one' }];
262262
adroll.options.events.push({ key: 'event', value: 'two' });
263263
analytics.track('event', { total: 2.99, orderId: 2 });

lib/adwords/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var AdWords = module.exports = integration('AdWords')
2222
* @api public
2323
*/
2424

25-
AdWords.prototype.initialize = function(){
25+
AdWords.prototype.initialize = function() {
2626
this.load(this.ready);
2727
};
2828

@@ -33,7 +33,7 @@ AdWords.prototype.initialize = function(){
3333
* @return {boolean}
3434
*/
3535

36-
AdWords.prototype.loaded = function(){
36+
AdWords.prototype.loaded = function() {
3737
return !!document.body;
3838
};
3939

@@ -49,7 +49,7 @@ AdWords.prototype.loaded = function(){
4949
* @param {Page} page
5050
*/
5151

52-
AdWords.prototype.page = function(){
52+
AdWords.prototype.page = function() {
5353
var remarketing = !!this.options.remarketing;
5454
var id = this.options.conversionId;
5555
var props = {};
@@ -67,11 +67,11 @@ AdWords.prototype.page = function(){
6767
* @param {Track}
6868
*/
6969

70-
AdWords.prototype.track = function(track){
70+
AdWords.prototype.track = function(track) {
7171
var id = this.options.conversionId;
7272
var events = this.events(track.event());
7373
var revenue = track.revenue() || 0;
74-
each(events, function(label){
74+
each(events, function(label) {
7575
var props = track.properties();
7676
delete props.revenue;
7777
window.google_trackConversion({

0 commit comments

Comments
 (0)