Skip to content

Commit 4a9a26c

Browse files
committed
Lint
1 parent 7a55699 commit 4a9a26c

Some content is hidden

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

42 files changed

+110
-110
lines changed

src/events/publish.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function eventFactory (arc) {
9191
function publish (arn, payload, callback) {
9292
client.sns.Publish({
9393
TopicArn: arn,
94-
Message: JSON.stringify(payload)
94+
Message: JSON.stringify(payload),
9595
})
9696
.then(result => callback(null, result))
9797
.catch(callback)
@@ -121,7 +121,7 @@ function queueFactory (arc) {
121121
let params = {
122122
QueueUrl: url,
123123
DelaySeconds: delaySeconds || 0,
124-
MessageBody: JSON.stringify(payload)
124+
MessageBody: JSON.stringify(payload),
125125
}
126126
if (url.endsWith('.fifo')) {
127127
params.MessageGroupId = groupID || name

src/events/subscribe.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ let parallel = require('run-parallel')
22

33
let fallback = {
44
Records: [
5-
{ Sns: { Message: JSON.stringify({}) } }
6-
]
5+
{ Sns: { Message: JSON.stringify({}) } },
6+
],
77
}
88

99
/**

src/http/_res-fmt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ module.exports = function responseFormatter (req, params) {
125125
let res = {
126126
headers: Object.assign({}, { 'content-type': type }, params.headers || {}),
127127
statusCode,
128-
body
128+
body,
129129
}
130130

131131
// REST API stuff

src/http/errors/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = function httpError (params) {
55
let {
66
statusCode = 502,
77
title = 'Unknown error',
8-
message = ''
8+
message = '',
99
} = params
1010
title = title === 'Error'
1111
? `${statusCode} error`
@@ -14,7 +14,7 @@ module.exports = function httpError (params) {
1414
statusCode,
1515
headers: {
1616
'content-type': 'text/html; charset=utf8;',
17-
'cache-control': 'no-cache, no-store, must-revalidate, max-age=0, s-maxage=0'
17+
'cache-control': 'no-cache, no-store, must-revalidate, max-age=0, s-maxage=0',
1818
},
1919
body: `
2020
<!DOCTYPE html>
@@ -83,6 +83,6 @@ module.exports = function httpError (params) {
8383
</div>
8484
</body>
8585
</html>
86-
`
86+
`,
8787
}
8888
}

src/http/helpers/binary-types.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ module.exports = [
5858
'application/x-rar-compressed',
5959
'application/x-tar',
6060
'application/x-zip',
61-
'application/zip'
61+
'application/zip',
6262
]

src/http/helpers/body-parser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = function parseBody (req) {
3535
: request.body
3636
request.body = JSON.parse(data) || {}
3737
}
38-
catch (e) {
38+
catch {
3939
throw Error('Invalid request body encoding or invalid JSON')
4040
}
4141
}

src/http/helpers/csrf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = function _csrf (req, res, next) {
77
else {
88
res({
99
status: 403,
10-
html: 'invalid csrf token'
10+
html: 'invalid csrf token',
1111
})
1212
}
1313
}

src/http/session/providers/ddb/create.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function _create (name, payload, callback) {
1818
if (err) callback(err)
1919
else callback(null, { _secret: val })
2020
})
21-
}
21+
},
2222
],
2323
function _put (err, results) {
2424
if (err) throw err
@@ -29,7 +29,7 @@ module.exports = function _create (name, payload, callback) {
2929
if (err) callback(err)
3030
else data._client.PutItem({
3131
TableName: name,
32-
Item: session
32+
Item: session,
3333
}).then(() => callback(null, session)).catch(callback)
3434
})
3535
})

src/http/session/providers/ddb/find.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function _find (name, _idx, callback) {
88
else data._client.GetItem({
99
TableName: name,
1010
ConsistentRead: true,
11-
Key: { _idx }
11+
Key: { _idx },
1212
})
1313
.then(item => {
1414
let result = typeof item === 'undefined' ? false : item.Item

src/http/session/providers/ddb/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function write (params, callback) {
103103
let sameSite = ARC_SESSION_SAME_SITE || 'lax'
104104
let options = {
105105
maxAge,
106-
expires: new Date(Date.now() + maxAge * 1000),
106+
expires: new Date(Date.now() + (maxAge * 1000)),
107107
secure: true,
108108
httpOnly: true,
109109
path: '/',

src/http/session/providers/ddb/update.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function _update (name, payload, callback) {
88
if (err) callback(err)
99
else data._client.PutItem({
1010
TableName: name,
11-
Item: session
11+
Item: session,
1212
}).then(() => callback(null, session)).catch(callback)
1313
})
1414
}

src/http/session/providers/jwe.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let jwe = {
4646
setupCrypto()
4747
const WEEK = 604800
4848
return jwt.parse(token).setTokenLifetime(WEEK).verify(key)
49-
}
49+
},
5050
}
5151

5252
/**
@@ -99,7 +99,7 @@ function write (payload, callback) {
9999
let sameSite = ARC_SESSION_SAME_SITE || 'lax'
100100
let options = {
101101
maxAge,
102-
expires: new Date(Date.now() + maxAge * 1000),
102+
expires: new Date(Date.now() + (maxAge * 1000)),
103103
secure: true,
104104
httpOnly: true,
105105
path: '/',

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let arc = {
3838
}
3939
})
4040
})
41-
}
41+
},
4242
}
4343
arc.events = require('./events')(arc, 'events')
4444
arc.queues = require('./events')(arc, 'queues')

src/lib/_get-ports.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = function getPorts (callback) {
1717
// Fall back to an internal SSM query in case Functions is running as a bare module
1818
else {
1919
// Require in here or circular dep warnings may occur
20-
// eslint-disable-next-line
20+
2121
let discovery = require('../discovery')
2222
discovery((err, services) => {
2323
if (err) callback(err)

src/tables/factory.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function dynamoConstructor (params, callback) {
137137

138138
update (params, callback) {
139139
return go(aws.dynamodb.UpdateItem, { ...params, TableName }, callback)
140-
}
140+
},
141141
}
142142
}
143143
callback(null, data)

src/tables/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = function tables (arc) {
4343
function (created, callback) {
4444
client = created
4545
callback(null, client)
46-
}
46+
},
4747
], callback)
4848
}
4949
return promise

src/tables/legacy.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ module.exports = function getLegacyDynamoClients ({ port, region }) {
1212
let DB, Doc
1313

1414
if (isNode18) {
15-
// eslint-disable-next-line
15+
1616
let dynamo = require('@aws-sdk/client-dynamodb')
17-
// eslint-disable-next-line
17+
1818
let docclient = require('@aws-sdk/lib-dynamodb')
1919
DB = dynamo.DynamoDB
2020
Doc = docclient.DynamoDBDocument
2121
}
2222
else {
23-
// eslint-disable-next-line
23+
2424
let dynamo = require('aws-sdk/clients/dynamodb')
2525
DB = dynamo
2626
Doc = dynamo.DocumentClient
@@ -37,8 +37,8 @@ module.exports = function getLegacyDynamoClients ({ port, region }) {
3737
keepAlive: true,
3838
maxSockets: 50, // Node can set to Infinity; AWS maxes at 50
3939
rejectUnauthorized: true,
40-
})
41-
}
40+
}),
41+
},
4242
}
4343
}
4444
client.db = new DB(config)
@@ -53,10 +53,10 @@ module.exports = function getLegacyDynamoClients ({ port, region }) {
5353
if (isNode18) {
5454
// Disable keep-alive locally (or wait Node's default 5s for sockets to time out)
5555
let http = require('http')
56-
// eslint-disable-next-line
56+
5757
let { NodeHttpHandler } = require('@smithy/node-http-handler')
5858
config.requestHandler = new NodeHttpHandler({
59-
httpAgent: new http.Agent({ keepAlive: false })
59+
httpAgent: new http.Agent({ keepAlive: false }),
6060
})
6161
}
6262
client.db = new DB(config)

src/tables/old.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ function __trigger (types, handler) {
3131
}
3232
}
3333

34-
/* eslint-disable indent */
34+
3535
module.exports = {
3636
insert: __trigger.bind({}, [ 'INSERT' ]),
3737
modify: __trigger.bind({}, [ 'MODIFY' ]),
3838
update: __trigger.bind({}, [ 'MODIFY' ]),
3939
remove: __trigger.bind({}, [ 'REMOVE' ]),
40-
destroy: __trigger.bind({}, [ 'REMOVE' ]),
41-
all: __trigger.bind({}, [ 'INSERT', 'MODIFY', 'REMOVE' ]),
42-
save: __trigger.bind({}, [ 'INSERT', 'MODIFY' ]),
43-
change: __trigger.bind({}, [ 'INSERT', 'REMOVE' ])
40+
destroy: __trigger.bind({}, [ 'REMOVE' ]),
41+
all: __trigger.bind({}, [ 'INSERT', 'MODIFY', 'REMOVE' ]),
42+
save: __trigger.bind({}, [ 'INSERT', 'MODIFY' ]),
43+
change: __trigger.bind({}, [ 'INSERT', 'REMOVE' ]),
4444
}

src/ws/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function instantiateAPI () {
66
if (client) res(client)
77

88
getAwsClient({
9-
plugins: [ import('@aws-lite/apigatewaymanagementapi') ]
9+
plugins: [ import('@aws-lite/apigatewaymanagementapi') ],
1010
}, (err, _client) => {
1111
if (err) rej(err)
1212
else {

test/integration/http-assets.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let port = process.env.PORT ? process.env.PORT : '3333'
77
let url = s => `http://localhost:${port}${s ? s : ''}`
88
let mock = join(__dirname, '..', 'mock', 'project')
99
let compress = {
10-
'accept-encoding': 'br'
10+
'accept-encoding': 'br',
1111
}
1212
let css = `/* css here! */\n`
1313
let js = `/* js here! */\n`

test/integration/http-session-jwe-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function getSession (url) {
1515
}
1616

1717
function checkKeys (session, t) {
18-
let { iat, } = session
18+
let { iat } = session
1919
if (!iat) t.fail(`Did not get back all internal session keys: ${JSON.stringify(session, null, 2)}`)
2020
else t.pass('Got back internal session key: iat')
2121
}

test/integration/static-fingerprinted-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test('Set up mocked arc', t => {
2020
t.ok(exists(join(shared, '.arc')), 'Mock .arc (shared) file ready')
2121
t.ok(exists(join(tmp, '.arc')), 'Mock .arc (root) file ready')
2222
process.chdir(tmp)
23-
// eslint-disable-next-line
23+
2424
arc = require('../..') // module globally inspects arc file so need to require after chdir
2525
})
2626

@@ -34,7 +34,7 @@ test('Set up mocked static manifest', t => {
3434
t.plan(2)
3535
copyFileSync(join(mock, 'mock-static'), join(shared, 'static.json'))
3636
t.ok(exists(join(shared, 'static.json')), 'Mock static.json file ready')
37-
// eslint-disable-next-line
37+
3838
static = require(join(shared, 'static.json'))
3939
t.ok(static['index.html'], 'Static manifest loaded')
4040
})

test/integration/static-plain-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('Set up mocked files', t => {
2323
t.ok(exists(join(shared, '.arc')), 'Mock .arc (shared) file ready')
2424
t.ok(exists(join(tmp, '.arc')), 'Mock .arc (root) file ready')
2525
process.chdir(tmp)
26-
// eslint-disable-next-line
26+
2727
arc = require('../..') // module globally inspects arc file so need to require after chdir
2828
})
2929

0 commit comments

Comments
 (0)