Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Apr 29, 2024
1 parent d1a8da6 commit 2b1947f
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 14 deletions.
2 changes: 0 additions & 2 deletions src/cli/_watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = function runWatcher (args, params) {

// Live reload starts within Sandbox, so we can only load it within the watcher
let livereload
// eslint-disable-next-line
livereload = require('../arc').livereload

try {
Expand Down Expand Up @@ -47,7 +46,6 @@ module.exports = function runWatcher (args, params) {
let end = Date.now()
update.done(`Sandbox reloaded in ${end - start}ms`)
// Rewrite the livereload WS server, or connected clients will be orphaned
// eslint-disable-next-line
livereload = require('../arc').livereload
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/events/_listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function eventBusListener (params, req, res) {
try {
message = JSON.parse(body)
}
catch (e) {
catch {
res.statusCode = 400
res.end('Sandbox @event bus exception parsing request body')
return
Expand Down
2 changes: 1 addition & 1 deletion src/http/register-websocket/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function connection (params, connectionId, ws) {
let payload = JSON.parse(msg)
lambda = payload.action && get.ws(payload.action)
}
catch (e) {
catch {
// fallback to default
}
if (lambda) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function start (params, callback) {
if (err) {
running._startupFailed = true
try { end(() => rej(err)) }
catch (e) { rej(err) }
catch { rej(err) }
}
else res(result)
}
Expand Down
4 changes: 0 additions & 4 deletions src/invoke-lambda/exec/runtimes/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ function client (method, params) {
try {
let { projectSrc, handlerFile, handlerMethod, shared, views } = JSON.parse(__ARC_CONFIG__);
let context = JSON.parse(__ARC_CONTEXT__);
/* eslint-disable-next-line */
let { join, sep } = require('path');
/* eslint-disable-next-line */
let { existsSync: exists, readFileSync: read } = require('fs');
let cwd = process.cwd();
delete process.env.__ARC_CONFIG__;
Expand All @@ -65,7 +63,6 @@ function client (method, params) {

async function run () {
/* Require first to populate the require cache for missing dependency warnings */
/* eslint-disable-next-line */
let handler = require(handlerFile)[handlerMethod];

/* Enumerate package files */
Expand Down Expand Up @@ -183,7 +180,6 @@ function client (method, params) {
await run();
}
catch (err) {
/* eslint-disable-next-line */
(async function initError () {
let unknown = 'Unknown init error';
console.log('Lambda init error:', err.body || err.message || unknown);
Expand Down
3 changes: 1 addition & 2 deletions src/sandbox/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ module.exports = function startupSeedData (params, callback) {
let data
try {
if (ext === 'json') data = JSON.parse(readFileSync(file))
// eslint-disable-next-line
else data = require(file)
}
catch (err) {
catch {
return callback(Error(`Failed to load seed data from ${file}`))
}

Expand Down
1 change: 0 additions & 1 deletion src/tables/_get-db-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = function initDynamoClient ({ creds, inventory, ports }, callbac
let plugins = [
// Binary dist mode
process.pkg
// eslint-disable-next-line
? require(join(__dirname, '_aws-lite-dynamodb-vendor.js'))
: import('@aws-lite/dynamodb'),
]
Expand Down
1 change: 0 additions & 1 deletion test/integration/events-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ function verifyPublish ({ t, pragma, event, file, message }) {
test('Set up env', t => {
t.plan(2)
setup(t)
// eslint-disable-next-line
arc = require('@architect/functions')
t.ok(sandbox, 'Got Sandbox')
})
Expand Down
1 change: 0 additions & 1 deletion test/integration/lambda-termination-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function check (t, altTimeout) {
test('Set up env', t => {
t.plan(2)
setup(t)
// eslint-disable-next-line
arc = require('@architect/functions')
t.ok(sandbox, 'Sandbox is present')
})
Expand Down

0 comments on commit 2b1947f

Please sign in to comment.