homarr-labs / homarr

Class methods should utilize this JS-0105
Anti-pattern
Minor
2 months ago5 months old
Expected 'this' to be used by class async method 'testConnectionAsync'
 11  }
 12
 13  // eslint-disable-next-line @typescript-eslint/no-empty-function
 14  public async testConnectionAsync(): Promise<void> {} 15}
 16
 17describe("Base integration", () => {
Expected 'this' to be used by class async method 'handleTestConnectionResponseAsync'
 35   */
 36  public abstract testConnectionAsync(): Promise<void>;
 37
 38  protected async handleTestConnectionResponseAsync({ 39    queryFunctionAsync,
 40    handleResponseAsync,
 41  }: {
Expected 'this' to be used by class method 'logQuery'
30export let database: HomarrDatabase;
31
32class WinstonDrizzleLogger implements Logger {
33  logQuery(query: string, _: unknown[]): void {34    logger.debug(`Executed SQL query: ${query}`);
35  }
36}
Expected 'this' to be used by class method 'logError'
13    logger.info(message);
14  }
15
16  logError(error: unknown) {17    logger.error(error);
18  }
19}
Expected 'this' to be used by class method 'logInfo'
 9    logger.debug(message);
10  }
11
12  logInfo(message: string) {13    logger.info(message);
14  }
15