Skip to content

Commit

Permalink
chore: enable no-confusing-void-expression (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Mar 1, 2024
1 parent a682244 commit 7df5c6c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ 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-floating-promises': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
Expand Down
11 changes: 6 additions & 5 deletions src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
});
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ export default async (options: RunnerOption): Promise<RunMigration[]> => {
} 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();
Expand Down
11 changes: 9 additions & 2 deletions src/sqlMigration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
};
};

Expand Down

0 comments on commit 7df5c6c

Please sign in to comment.