Enable no-unsafe-return rule

This commit is contained in:
Henry Mercer 2024-06-13 19:52:39 +01:00
parent 2f54d9fcfa
commit 1ea11ca775
16 changed files with 30 additions and 26 deletions

View file

@ -309,7 +309,7 @@ async function uploadPayload(
payload: any,
repositoryNwo: RepositoryNwo,
logger: Logger,
) {
): Promise<string> {
logger.info("Uploading results");
// If in test mode we don't want to upload the results
@ -323,7 +323,7 @@ async function uploadPayload(
);
logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`);
fs.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2));
return;
return "test-mode-sarif-id";
}
const client = api.getApiClient();
@ -340,7 +340,7 @@ async function uploadPayload(
logger.debug(`response status: ${response.status}`);
logger.info("Successfully uploaded results");
return response.data.id;
return response.data.id as string;
} catch (e) {
if (util.isHTTPError(e)) {
switch (e.status) {