Skip to content

Commit 8a5d2dc

Browse files
committed
refactor: eslint fix
1 parent 7c8bb1d commit 8a5d2dc

Some content is hidden

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

52 files changed

+3025
-6499
lines changed

.eslintrc.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module.exports = {
2-
extends: 'standard',
3-
globals: {
4-
test: true,
5-
expect: true,
6-
describe: true,
7-
beforeEach: true,
8-
jest: true
9-
}
10-
};
2+
extends: 'standard',
3+
globals: {
4+
test: true,
5+
expect: true,
6+
describe: true,
7+
beforeEach: true,
8+
jest: true
9+
}
10+
}

__tests__/integration.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo
5050
httpMethod: 'GET'
5151
})
5252
const response = await serverlessExpressInstance.handler(event)
53-
const expected = `<!DOCTYPE html><html><body>/</body></html>`
53+
const expected = '<!DOCTYPE html><html><body>/</body></html>'
5454
expect(response.body).toEqual(expected)
5555
const expectedResponse = makeResponse({
5656
eventSourceName,
@@ -178,7 +178,7 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo
178178
const response = await serverlessExpressInstance.handler(event)
179179
const expectedResponse = makeResponse({
180180
eventSourceName,
181-
body: JSON.stringify({id: '3'}),
181+
body: JSON.stringify({ id: '3' }),
182182
multiValueHeaders: {
183183
'content-length': ['10'],
184184
etag: ['W/"a-lfm5LdsGBlIttC0+rnSiywX9+Wc"']
@@ -218,30 +218,30 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo
218218
const lastModifiedRegex = /^.* GMT$/
219219
switch (eventSourceName) {
220220
case 'alb':
221-
case 'apiGatewayV1':
221+
case 'apiGatewayV1':
222222
expect(response.multiValueHeaders.etag.length).toEqual(1)
223223
expect(response.multiValueHeaders.etag[0]).toMatch(etagRegex)
224224
expect(response.multiValueHeaders['last-modified'].length).toEqual(1)
225225
expect(response.multiValueHeaders['last-modified'][0]).toMatch(lastModifiedRegex)
226226
delete response.multiValueHeaders.etag
227227
delete response.multiValueHeaders['last-modified']
228228
break
229-
case 'apiGatewayV2':
230-
expect(response.headers.etag).toMatch(etagRegex)
231-
expect(response.headers['last-modified']).toMatch(lastModifiedRegex)
232-
delete response.headers.etag
233-
delete response.headers['last-modified']
234-
break
235-
case 'lambdaEdge':
236-
expect(response.headers.etag.length).toEqual(1)
237-
expect(response.headers.etag[0].key).toMatch('etag')
238-
expect(response.headers.etag[0].value).toMatch(etagRegex)
239-
expect(response.headers['last-modified'].length).toEqual(1)
240-
expect(response.headers['last-modified'][0].key).toMatch('last-modified')
241-
expect(response.headers['last-modified'][0].value).toMatch(lastModifiedRegex)
242-
delete response.headers.etag
243-
delete response.headers['last-modified']
244-
break
229+
case 'apiGatewayV2':
230+
expect(response.headers.etag).toMatch(etagRegex)
231+
expect(response.headers['last-modified']).toMatch(lastModifiedRegex)
232+
delete response.headers.etag
233+
delete response.headers['last-modified']
234+
break
235+
case 'lambdaEdge':
236+
expect(response.headers.etag.length).toEqual(1)
237+
expect(response.headers.etag[0].key).toMatch('etag')
238+
expect(response.headers.etag[0].value).toMatch(etagRegex)
239+
expect(response.headers['last-modified'].length).toEqual(1)
240+
expect(response.headers['last-modified'][0].key).toMatch('last-modified')
241+
expect(response.headers['last-modified'][0].value).toMatch(lastModifiedRegex)
242+
delete response.headers.etag
243+
delete response.headers['last-modified']
244+
break
245245
}
246246
expect(response).toEqual(expectedResponse)
247247
})

examples/basic-starter-api-gateway-v1/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
new CopyPlugin({
1717
patterns: [
1818
{ from: './src/views', to: 'views' },
19-
{ from: './src/sam-logo.png' },
19+
{ from: './src/sam-logo.png' }
2020
]
2121
})
2222
]

examples/basic-starter-hapi/src/app.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ server.route({
88
method: 'GET',
99
path: '/',
1010
handler: (request, h) => {
11-
12-
return 'Hello World!';
11+
return 'Hello World!'
1312
}
1413
})
1514
module.exports = server.listener._events.request

examples/lambda-edge/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
new CopyPlugin({
1717
patterns: [
1818
{ from: './src/views', to: 'views' },
19-
{ from: './src/sam-logo.png' },
19+
{ from: './src/sam-logo.png' }
2020
]
2121
})
2222
]

examples/sails/Gruntfile.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212
* For more information see:
1313
* https://sailsjs.com/anatomy/Gruntfile.js
1414
*/
15-
module.exports = function(grunt) {
16-
17-
var loadGruntTasks = require('sails-hook-grunt/accessible/load-grunt-tasks');
15+
module.exports = function (grunt) {
16+
const loadGruntTasks = require('sails-hook-grunt/accessible/load-grunt-tasks');
1817

1918
// Load Grunt task configurations (from `tasks/config/`) and Grunt
2019
// task registrations (from `tasks/register/`).
2120
loadGruntTasks(__dirname, grunt);
22-
2321
};

examples/sails/config/blueprints.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ module.exports.blueprints = {
1919

2020
// actions: false,
2121

22-
2322
/***************************************************************************
2423
* *
2524
* Automatically expose RESTful routes for your models? *
@@ -28,7 +27,6 @@ module.exports.blueprints = {
2827

2928
// rest: true,
3029

31-
3230
/***************************************************************************
3331
* *
3432
* Automatically expose CRUD "shortcut" routes to GET requests? *

examples/sails/config/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* https://sailsjs.com/config/bootstrap
1010
*/
1111

12-
module.exports.bootstrap = async function() {
12+
module.exports.bootstrap = async function () {
1313

1414
// By convention, this is a good place to set up fake data during development.
1515
//

examples/sails/config/datastores.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
module.exports.datastores = {
1717

18-
1918
/***************************************************************************
2019
* *
2120
* Your app's default datastore. *
@@ -51,7 +50,6 @@ module.exports.datastores = {
5150
// adapter: 'sails-mysql',
5251
// url: 'mysql://user:password@host:port/database',
5352

54-
},
55-
53+
}
5654

5755
};

examples/sails/config/env/production.js

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
module.exports = {
2323

24-
2524
/**************************************************************************
2625
* *
2726
* Tell Sails what database(s) it should use in production. *
@@ -49,15 +48,15 @@ module.exports = {
4948
default: {
5049
// adapter: 'sails-mysql',
5150
// url: 'mysql://user:password@host:port/database',
52-
//--------------------------------------------------------------------------
51+
// --------------------------------------------------------------------------
5352
// /\ To avoid checking it in to version control, you might opt to set
5453
// || sensitive credentials like `url` using an environment variable.
5554
//
5655
// For example:
5756
// ```
5857
// sails_datastores__default__url=mysql://admin:[email protected]:3306/my_prod_db
5958
// ```
60-
//--------------------------------------------------------------------------
59+
// --------------------------------------------------------------------------
6160

6261
/****************************************************************************
6362
*                         *
@@ -72,12 +71,10 @@ module.exports = {
7271
****************************************************************************/
7372
// ssl: true,
7473

75-
},
74+
}
7675

7776
},
7877

79-
80-
8178
models: {
8279

8380
/***************************************************************************
@@ -90,7 +87,7 @@ module.exports = {
9087
* https://sailsjs.com/docs/concepts/models-and-orm/model-settings#?migrate *
9188
* *
9289
***************************************************************************/
93-
migrate: 'safe',
90+
migrate: 'safe'
9491

9592
/***************************************************************************
9693
* *
@@ -105,8 +102,6 @@ module.exports = {
105102

106103
},
107104

108-
109-
110105
/**************************************************************************
111106
* *
112107
* Always disable "shortcut" blueprint routes. *
@@ -118,11 +113,9 @@ module.exports = {
118113
* *
119114
***************************************************************************/
120115
blueprints: {
121-
shortcuts: false,
116+
shortcuts: false
122117
},
123118

124-
125-
126119
/***************************************************************************
127120
* *
128121
* Configure your security settings for production. *
@@ -151,12 +144,10 @@ module.exports = {
151144
// allowOrigins: [
152145
// 'https://example.com',
153146
// ]
154-
},
147+
}
155148

156149
},
157150

158-
159-
160151
/***************************************************************************
161152
* *
162153
* Configure how your app handles sessions in production. *
@@ -186,7 +177,7 @@ module.exports = {
186177
***************************************************************************/
187178
// adapter: '@sailshq/connect-redis',
188179
// url: 'redis://user:password@localhost:6379/databasenumber',
189-
//--------------------------------------------------------------------------
180+
// --------------------------------------------------------------------------
190181
// /\ OR, to avoid checking it in to version control, you might opt to
191182
// || set sensitive credentials like this using an environment variable.
192183
//
@@ -195,9 +186,7 @@ module.exports = {
195186
// sails_session__url=redis://admin:[email protected]:9562/0
196187
// ```
197188
//
198-
//--------------------------------------------------------------------------
199-
200-
189+
// --------------------------------------------------------------------------
201190

202191
/***************************************************************************
203192
* *
@@ -222,13 +211,11 @@ module.exports = {
222211
***************************************************************************/
223212
cookie: {
224213
// secure: true,
225-
maxAge: 24 * 60 * 60 * 1000, // 24 hours
226-
},
214+
maxAge: 24 * 60 * 60 * 1000 // 24 hours
215+
}
227216

228217
},
229218

230-
231-
232219
/**************************************************************************
233220
* *
234221
* Set up Socket.io for your production environment. *
@@ -255,7 +242,6 @@ module.exports = {
255242
// 'https://staging.example.com',
256243
// ],
257244

258-
259245
/***************************************************************************
260246
* *
261247
* If you are deploying a cluster of multiple servers and/or processes, *
@@ -270,20 +256,18 @@ module.exports = {
270256
***************************************************************************/
271257
// adapter: '@sailshq/socket.io-redis',
272258
// url: 'redis://user:[email protected]:9562/databasenumber',
273-
//--------------------------------------------------------------------------
259+
// --------------------------------------------------------------------------
274260
// /\ OR, to avoid checking it in to version control, you might opt to
275261
// || set sensitive credentials like this using an environment variable.
276262
//
277263
// For example:
278264
// ```
279265
// sails_sockets__url=redis://admin:[email protected]:9562/0
280266
// ```
281-
//--------------------------------------------------------------------------
267+
// --------------------------------------------------------------------------
282268

283269
},
284270

285-
286-
287271
/**************************************************************************
288272
* *
289273
* Set the production log level. *
@@ -295,8 +279,6 @@ module.exports = {
295279
level: 'debug'
296280
},
297281

298-
299-
300282
http: {
301283

302284
/***************************************************************************
@@ -305,7 +287,7 @@ module.exports = {
305287
* (the "max-age" to include in the "Cache-Control" response header) *
306288
* *
307289
***************************************************************************/
308-
cache: 365.25 * 24 * 60 * 60 * 1000, // One year
290+
cache: 365.25 * 24 * 60 * 60 * 1000 // One year
309291

310292
/***************************************************************************
311293
* *
@@ -326,8 +308,6 @@ module.exports = {
326308

327309
},
328310

329-
330-
331311
/**************************************************************************
332312
* *
333313
* Lift the server on port 80. *
@@ -339,8 +319,6 @@ module.exports = {
339319
***************************************************************************/
340320
// port: 80,
341321

342-
343-
344322
/**************************************************************************
345323
* *
346324
* Configure an SSL certificate *
@@ -360,8 +338,6 @@ module.exports = {
360338
**************************************************************************/
361339
// ssl: undefined,
362340

363-
364-
365341
/**************************************************************************
366342
* *
367343
* Production overrides for any custom settings specific to your app. *
@@ -372,12 +348,12 @@ module.exports = {
372348
***************************************************************************/
373349
custom: {
374350
baseUrl: 'https://example.com',
375-
internalEmailAddress: '[email protected]',
351+
internalEmailAddress: '[email protected]'
376352

377353
// mailgunDomain: 'mg.example.com',
378354
// mailgunSecret: 'key-prod_fake_bd32301385130a0bafe030c',
379355
// stripeSecret: 'sk_prod__fake_Nfgh82401348jaDa3lkZ0d9Hm',
380-
//--------------------------------------------------------------------------
356+
// --------------------------------------------------------------------------
381357
// /\ OR, to avoid checking them in to version control, you might opt to
382358
// || set sensitive credentials like these using environment variables.
383359
//
@@ -387,10 +363,8 @@ module.exports = {
387363
// sails_custom__mailgunSecret=key-prod_fake_bd32301385130a0bafe030c
388364
// sails_custom__stripeSecret=sk_prod__fake_Nfgh82401348jaDa3lkZ0d9Hm
389365
// ```
390-
//--------------------------------------------------------------------------
391-
392-
},
393-
366+
// --------------------------------------------------------------------------
394367

368+
}
395369

396370
};

0 commit comments

Comments
 (0)