fix: Set '@typescript-eslint/return-await' rule to 'always' for node code (no-changelog) (#8363)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -171,7 +171,7 @@ export class SourceControlService {
|
||||
await this.initGitService();
|
||||
}
|
||||
await this.gitService.fetch();
|
||||
return this.gitService.getBranches();
|
||||
return await this.gitService.getBranches();
|
||||
}
|
||||
|
||||
async setBranch(branch: string): Promise<{ branches: string[]; currentBranch: string }> {
|
||||
@@ -182,7 +182,7 @@ export class SourceControlService {
|
||||
branchName: branch,
|
||||
connected: branch?.length > 0,
|
||||
});
|
||||
return this.gitService.setBranch(branch);
|
||||
return await this.gitService.setBranch(branch);
|
||||
}
|
||||
|
||||
// will reset the branch to the remote branch and pull
|
||||
|
||||
@@ -95,7 +95,7 @@ export class SourceControlExportService {
|
||||
owner: owners[e.id],
|
||||
};
|
||||
this.logger.debug(`Writing workflow ${e.id} to ${fileName}`);
|
||||
return fsWriteFile(fileName, JSON.stringify(sanitizedWorkflow, null, 2));
|
||||
return await fsWriteFile(fileName, JSON.stringify(sanitizedWorkflow, null, 2));
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ export class SourceControlExportService {
|
||||
nodesAccess: sharedCredential.credentials.nodesAccess,
|
||||
};
|
||||
this.logger.debug(`Writing credential ${sharedCredential.credentials.id} to ${fileName}`);
|
||||
return fsWriteFile(fileName, JSON.stringify(sanitizedCredential, null, 2));
|
||||
return await fsWriteFile(fileName, JSON.stringify(sanitizedCredential, null, 2));
|
||||
}),
|
||||
);
|
||||
return {
|
||||
|
||||
@@ -232,7 +232,7 @@ export class SourceControlGitService {
|
||||
}
|
||||
await this.git.checkout(branch);
|
||||
await this.git.branch([`--set-upstream-to=${SOURCE_CONTROL_ORIGIN}/${branch}`, branch]);
|
||||
return this.getBranches();
|
||||
return await this.getBranches();
|
||||
}
|
||||
|
||||
async getCurrentBranch(): Promise<{ current: string; remote: string }> {
|
||||
@@ -253,7 +253,7 @@ export class SourceControlGitService {
|
||||
const currentBranch = await this.getCurrentBranch();
|
||||
if (currentBranch.remote) {
|
||||
const target = currentBranch.remote;
|
||||
return this.git.diffSummary(['...' + target, '--ignore-all-space']);
|
||||
return await this.git.diffSummary(['...' + target, '--ignore-all-space']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ export class SourceControlGitService {
|
||||
const currentBranch = await this.getCurrentBranch();
|
||||
if (currentBranch.remote) {
|
||||
const target = currentBranch.current;
|
||||
return this.git.diffSummary([target, '--ignore-all-space']);
|
||||
return await this.git.diffSummary([target, '--ignore-all-space']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ export class SourceControlGitService {
|
||||
if (!this.git) {
|
||||
throw new ApplicationError('Git is not initialized (fetch)');
|
||||
}
|
||||
return this.git.fetch();
|
||||
return await this.git.fetch();
|
||||
}
|
||||
|
||||
async pull(options: { ffOnly: boolean } = { ffOnly: true }): Promise<PullResult> {
|
||||
@@ -286,7 +286,7 @@ export class SourceControlGitService {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
Object.assign(params, { '--ff-only': true });
|
||||
}
|
||||
return this.git.pull(params);
|
||||
return await this.git.pull(params);
|
||||
}
|
||||
|
||||
async push(
|
||||
@@ -300,9 +300,9 @@ export class SourceControlGitService {
|
||||
throw new ApplicationError('Git is not initialized ({)');
|
||||
}
|
||||
if (force) {
|
||||
return this.git.push(SOURCE_CONTROL_ORIGIN, branch, ['-f']);
|
||||
return await this.git.push(SOURCE_CONTROL_ORIGIN, branch, ['-f']);
|
||||
}
|
||||
return this.git.push(SOURCE_CONTROL_ORIGIN, branch);
|
||||
return await this.git.push(SOURCE_CONTROL_ORIGIN, branch);
|
||||
}
|
||||
|
||||
async stage(files: Set<string>, deletedFiles?: Set<string>): Promise<string> {
|
||||
@@ -316,7 +316,7 @@ export class SourceControlGitService {
|
||||
this.logger.debug(`Git rm: ${(error as Error).message}`);
|
||||
}
|
||||
}
|
||||
return this.git.add(Array.from(files));
|
||||
return await this.git.add(Array.from(files));
|
||||
}
|
||||
|
||||
async resetBranch(
|
||||
@@ -326,9 +326,9 @@ export class SourceControlGitService {
|
||||
throw new ApplicationError('Git is not initialized (Promise)');
|
||||
}
|
||||
if (options?.hard) {
|
||||
return this.git.raw(['reset', '--hard', options.target]);
|
||||
return await this.git.raw(['reset', '--hard', options.target]);
|
||||
}
|
||||
return this.git.raw(['reset', options.target]);
|
||||
return await this.git.raw(['reset', options.target]);
|
||||
// built-in reset method does not work
|
||||
// return this.git.reset();
|
||||
}
|
||||
@@ -337,7 +337,7 @@ export class SourceControlGitService {
|
||||
if (!this.git) {
|
||||
throw new ApplicationError('Git is not initialized (commit)');
|
||||
}
|
||||
return this.git.commit(message);
|
||||
return await this.git.commit(message);
|
||||
}
|
||||
|
||||
async status(): Promise<StatusResult> {
|
||||
|
||||
@@ -186,7 +186,7 @@ export class SourceControlImportService {
|
||||
}
|
||||
|
||||
public async getLocalVariablesFromDb(): Promise<Variables[]> {
|
||||
return this.variablesService.getAllCached();
|
||||
return await this.variablesService.getAllCached();
|
||||
}
|
||||
|
||||
public async getRemoteTagsAndMappingsFromFile(): Promise<{
|
||||
|
||||
@@ -23,7 +23,7 @@ export class VariablesController {
|
||||
@Get('/')
|
||||
@RequireGlobalScope('variable:list')
|
||||
async getVariables() {
|
||||
return this.variablesService.getAllCached();
|
||||
return await this.variablesService.getAllCached();
|
||||
}
|
||||
|
||||
@Post('/')
|
||||
|
||||
@@ -18,7 +18,7 @@ export class VariablesService {
|
||||
async getAllCached(): Promise<Variables[]> {
|
||||
const variables = await this.cacheService.get('variables', {
|
||||
async refreshFn() {
|
||||
return Container.get(VariablesService).findAll();
|
||||
return await Container.get(VariablesService).findAll();
|
||||
},
|
||||
});
|
||||
return (variables as Array<Partial<Variables>>).map((v) => this.variablesRepository.create(v));
|
||||
@@ -49,7 +49,7 @@ export class VariablesService {
|
||||
}
|
||||
|
||||
async findAll(): Promise<Variables[]> {
|
||||
return this.variablesRepository.find();
|
||||
return await this.variablesRepository.find();
|
||||
}
|
||||
|
||||
validateVariable(variable: Omit<Variables, 'id'>): void {
|
||||
|
||||
Reference in New Issue
Block a user