diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1e07de12..34ecfcc8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -85,7 +85,7 @@ module.exports = defineConfig({ // TODO @Shinigami92 2024-02-29: Remove these later '@typescript-eslint/no-base-to-string': 'off', - '@typescript-eslint/no-confusing-void-expression': 'off', + // '@typescript-eslint/no-confusing-void-expression': 'off', '@typescript-eslint/no-floating-promises': 'off', '@typescript-eslint/no-implied-eval': 'off', '@typescript-eslint/no-redundant-type-constituents': 'off', diff --git a/src/db.ts b/src/db.ts index 82e808b9..8de4086b 100644 --- a/src/db.ts +++ b/src/db.ts @@ -69,11 +69,12 @@ const db = ( if (err) { connectionStatus = ConnectionStatus.ERROR; logger.error(`could not connect to postgres: ${inspect(err)}`); - return reject(err); + reject(err); + return; } connectionStatus = ConnectionStatus.CONNECTED; - return resolve(); + resolve(); }); } }); @@ -144,9 +145,9 @@ ${err} close: async () => { await beforeCloseListeners.reduce( (promise, listener) => - promise - .then(listener) - .catch((err: any) => logger.error(err.stack || err)), + promise.then(listener).catch((err: any) => { + logger.error(err.stack || err); + }), Promise.resolve() ); if (!isExternalClient) { diff --git a/src/runner.ts b/src/runner.ts index befcba41..d4b0d4bf 100644 --- a/src/runner.ts +++ b/src/runner.ts @@ -311,7 +311,9 @@ export default async (options: RunnerOption): Promise => { } finally { if (db.connected()) { if (!options.noLock) { - await unlock(db).catch((error) => logger.warn(error.message)); + await unlock(db).catch((error) => { + logger.warn(error.message); + }); } db.close(); diff --git a/src/sqlMigration.ts b/src/sqlMigration.ts index 11ec5c6f..c4f2b2bb 100644 --- a/src/sqlMigration.ts +++ b/src/sqlMigration.ts @@ -29,8 +29,15 @@ export const getActions = (content: string): MigrationBuilderActions => { : undefined; return { - up: (pgm) => pgm.sql(upSql), - down: downSql === undefined ? false : (pgm) => pgm.sql(downSql), + up: (pgm) => { + pgm.sql(upSql); + }, + down: + downSql === undefined + ? false + : (pgm) => { + pgm.sql(downSql); + }, }; };