Skip to content

Commit

Permalink
refactor: eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brett-vendia committed Feb 1, 2021
1 parent 7c8bb1d commit 8a5d2dc
Show file tree
Hide file tree
Showing 52 changed files with 3,025 additions and 6,499 deletions.
18 changes: 9 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
extends: 'standard',
globals: {
test: true,
expect: true,
describe: true,
beforeEach: true,
jest: true
}
};
extends: 'standard',
globals: {
test: true,
expect: true,
describe: true,
beforeEach: true,
jest: true
}
}
38 changes: 19 additions & 19 deletions __tests__/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo
httpMethod: 'GET'
})
const response = await serverlessExpressInstance.handler(event)
const expected = `<!DOCTYPE html><html><body>/</body></html>`
const expected = '<!DOCTYPE html><html><body>/</body></html>'
expect(response.body).toEqual(expected)
const expectedResponse = makeResponse({
eventSourceName,
Expand Down Expand Up @@ -178,7 +178,7 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo
const response = await serverlessExpressInstance.handler(event)
const expectedResponse = makeResponse({
eventSourceName,
body: JSON.stringify({id: '3'}),
body: JSON.stringify({ id: '3' }),
multiValueHeaders: {
'content-length': ['10'],
etag: ['W/"a-lfm5LdsGBlIttC0+rnSiywX9+Wc"']
Expand Down Expand Up @@ -218,30 +218,30 @@ describe.each(EACH_MATRIX)('%s:%s: integration tests', (eventSourceName, framewo
const lastModifiedRegex = /^.* GMT$/
switch (eventSourceName) {
case 'alb':
case 'apiGatewayV1':
case 'apiGatewayV1':
expect(response.multiValueHeaders.etag.length).toEqual(1)
expect(response.multiValueHeaders.etag[0]).toMatch(etagRegex)
expect(response.multiValueHeaders['last-modified'].length).toEqual(1)
expect(response.multiValueHeaders['last-modified'][0]).toMatch(lastModifiedRegex)
delete response.multiValueHeaders.etag
delete response.multiValueHeaders['last-modified']
break
case 'apiGatewayV2':
expect(response.headers.etag).toMatch(etagRegex)
expect(response.headers['last-modified']).toMatch(lastModifiedRegex)
delete response.headers.etag
delete response.headers['last-modified']
break
case 'lambdaEdge':
expect(response.headers.etag.length).toEqual(1)
expect(response.headers.etag[0].key).toMatch('etag')
expect(response.headers.etag[0].value).toMatch(etagRegex)
expect(response.headers['last-modified'].length).toEqual(1)
expect(response.headers['last-modified'][0].key).toMatch('last-modified')
expect(response.headers['last-modified'][0].value).toMatch(lastModifiedRegex)
delete response.headers.etag
delete response.headers['last-modified']
break
case 'apiGatewayV2':
expect(response.headers.etag).toMatch(etagRegex)
expect(response.headers['last-modified']).toMatch(lastModifiedRegex)
delete response.headers.etag
delete response.headers['last-modified']
break
case 'lambdaEdge':
expect(response.headers.etag.length).toEqual(1)
expect(response.headers.etag[0].key).toMatch('etag')
expect(response.headers.etag[0].value).toMatch(etagRegex)
expect(response.headers['last-modified'].length).toEqual(1)
expect(response.headers['last-modified'][0].key).toMatch('last-modified')
expect(response.headers['last-modified'][0].value).toMatch(lastModifiedRegex)
delete response.headers.etag
delete response.headers['last-modified']
break
}
expect(response).toEqual(expectedResponse)
})
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-starter-api-gateway-v1/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
new CopyPlugin({
patterns: [
{ from: './src/views', to: 'views' },
{ from: './src/sam-logo.png' },
{ from: './src/sam-logo.png' }
]
})
]
Expand Down
3 changes: 1 addition & 2 deletions examples/basic-starter-hapi/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ server.route({
method: 'GET',
path: '/',
handler: (request, h) => {

return 'Hello World!';
return 'Hello World!'
}
})
module.exports = server.listener._events.request
2 changes: 1 addition & 1 deletion examples/lambda-edge/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
new CopyPlugin({
patterns: [
{ from: './src/views', to: 'views' },
{ from: './src/sam-logo.png' },
{ from: './src/sam-logo.png' }
]
})
]
Expand Down
6 changes: 2 additions & 4 deletions examples/sails/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
* For more information see:
* https://sailsjs.com/anatomy/Gruntfile.js
*/
module.exports = function(grunt) {

var loadGruntTasks = require('sails-hook-grunt/accessible/load-grunt-tasks');
module.exports = function (grunt) {
const loadGruntTasks = require('sails-hook-grunt/accessible/load-grunt-tasks');

// Load Grunt task configurations (from `tasks/config/`) and Grunt
// task registrations (from `tasks/register/`).
loadGruntTasks(__dirname, grunt);

};
2 changes: 0 additions & 2 deletions examples/sails/config/blueprints.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports.blueprints = {

// actions: false,


/***************************************************************************
* *
* Automatically expose RESTful routes for your models? *
Expand All @@ -28,7 +27,6 @@ module.exports.blueprints = {

// rest: true,


/***************************************************************************
* *
* Automatically expose CRUD "shortcut" routes to GET requests? *
Expand Down
2 changes: 1 addition & 1 deletion examples/sails/config/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* https://sailsjs.com/config/bootstrap
*/

module.exports.bootstrap = async function() {
module.exports.bootstrap = async function () {

// By convention, this is a good place to set up fake data during development.
//
Expand Down
4 changes: 1 addition & 3 deletions examples/sails/config/datastores.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

module.exports.datastores = {


/***************************************************************************
* *
* Your app's default datastore. *
Expand Down Expand Up @@ -51,7 +50,6 @@ module.exports.datastores = {
// adapter: 'sails-mysql',
// url: 'mysql://user:password@host:port/database',

},

}

};
60 changes: 17 additions & 43 deletions examples/sails/config/env/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

module.exports = {


/**************************************************************************
* *
* Tell Sails what database(s) it should use in production. *
Expand Down Expand Up @@ -49,15 +48,15 @@ module.exports = {
default: {
// adapter: 'sails-mysql',
// url: 'mysql://user:password@host:port/database',
//--------------------------------------------------------------------------
// --------------------------------------------------------------------------
// /\ To avoid checking it in to version control, you might opt to set
// || sensitive credentials like `url` using an environment variable.
//
// For example:
// ```
// sails_datastores__default__url=mysql://admin:myc00lpAssw2D@db.example.com:3306/my_prod_db
// ```
//--------------------------------------------------------------------------
// --------------------------------------------------------------------------

/****************************************************************************
*                         *
Expand All @@ -72,12 +71,10 @@ module.exports = {
****************************************************************************/
// ssl: true,

},
}

},



models: {

/***************************************************************************
Expand All @@ -90,7 +87,7 @@ module.exports = {
* https://sailsjs.com/docs/concepts/models-and-orm/model-settings#?migrate *
* *
***************************************************************************/
migrate: 'safe',
migrate: 'safe'

/***************************************************************************
* *
Expand All @@ -105,8 +102,6 @@ module.exports = {

},



/**************************************************************************
* *
* Always disable "shortcut" blueprint routes. *
Expand All @@ -118,11 +113,9 @@ module.exports = {
* *
***************************************************************************/
blueprints: {
shortcuts: false,
shortcuts: false
},



/***************************************************************************
* *
* Configure your security settings for production. *
Expand Down Expand Up @@ -151,12 +144,10 @@ module.exports = {
// allowOrigins: [
// 'https://example.com',
// ]
},
}

},



/***************************************************************************
* *
* Configure how your app handles sessions in production. *
Expand Down Expand Up @@ -186,7 +177,7 @@ module.exports = {
***************************************************************************/
// adapter: '@sailshq/connect-redis',
// url: 'redis://user:password@localhost:6379/databasenumber',
//--------------------------------------------------------------------------
// --------------------------------------------------------------------------
// /\ OR, to avoid checking it in to version control, you might opt to
// || set sensitive credentials like this using an environment variable.
//
Expand All @@ -195,9 +186,7 @@ module.exports = {
// sails_session__url=redis://admin:myc00lpAssw2D@bigsquid.redistogo.com:9562/0
// ```
//
//--------------------------------------------------------------------------


// --------------------------------------------------------------------------

/***************************************************************************
* *
Expand All @@ -222,13 +211,11 @@ module.exports = {
***************************************************************************/
cookie: {
// secure: true,
maxAge: 24 * 60 * 60 * 1000, // 24 hours
},
maxAge: 24 * 60 * 60 * 1000 // 24 hours
}

},



/**************************************************************************
* *
* Set up Socket.io for your production environment. *
Expand All @@ -255,7 +242,6 @@ module.exports = {
// 'https://staging.example.com',
// ],


/***************************************************************************
* *
* If you are deploying a cluster of multiple servers and/or processes, *
Expand All @@ -270,20 +256,18 @@ module.exports = {
***************************************************************************/
// adapter: '@sailshq/socket.io-redis',
// url: 'redis://user:password@bigsquid.redistogo.com:9562/databasenumber',
//--------------------------------------------------------------------------
// --------------------------------------------------------------------------
// /\ OR, to avoid checking it in to version control, you might opt to
// || set sensitive credentials like this using an environment variable.
//
// For example:
// ```
// sails_sockets__url=redis://admin:myc00lpAssw2D@bigsquid.redistogo.com:9562/0
// ```
//--------------------------------------------------------------------------
// --------------------------------------------------------------------------

},



/**************************************************************************
* *
* Set the production log level. *
Expand All @@ -295,8 +279,6 @@ module.exports = {
level: 'debug'
},



http: {

/***************************************************************************
Expand All @@ -305,7 +287,7 @@ module.exports = {
* (the "max-age" to include in the "Cache-Control" response header) *
* *
***************************************************************************/
cache: 365.25 * 24 * 60 * 60 * 1000, // One year
cache: 365.25 * 24 * 60 * 60 * 1000 // One year

/***************************************************************************
* *
Expand All @@ -326,8 +308,6 @@ module.exports = {

},



/**************************************************************************
* *
* Lift the server on port 80. *
Expand All @@ -339,8 +319,6 @@ module.exports = {
***************************************************************************/
// port: 80,



/**************************************************************************
* *
* Configure an SSL certificate *
Expand All @@ -360,8 +338,6 @@ module.exports = {
**************************************************************************/
// ssl: undefined,



/**************************************************************************
* *
* Production overrides for any custom settings specific to your app. *
Expand All @@ -372,12 +348,12 @@ module.exports = {
***************************************************************************/
custom: {
baseUrl: 'https://example.com',
internalEmailAddress: 'support@example.com',
internalEmailAddress: 'support@example.com'

// mailgunDomain: 'mg.example.com',
// mailgunSecret: 'key-prod_fake_bd32301385130a0bafe030c',
// stripeSecret: 'sk_prod__fake_Nfgh82401348jaDa3lkZ0d9Hm',
//--------------------------------------------------------------------------
// --------------------------------------------------------------------------
// /\ OR, to avoid checking them in to version control, you might opt to
// || set sensitive credentials like these using environment variables.
//
Expand All @@ -387,10 +363,8 @@ module.exports = {
// sails_custom__mailgunSecret=key-prod_fake_bd32301385130a0bafe030c
// sails_custom__stripeSecret=sk_prod__fake_Nfgh82401348jaDa3lkZ0d9Hm
// ```
//--------------------------------------------------------------------------

},

// --------------------------------------------------------------------------

}

};
Loading

0 comments on commit 8a5d2dc

Please sign in to comment.