Resolve violations of no-throw-literal lint

Resolves #204
This commit is contained in:
Michael Huynh 2020-09-25 17:39:25 +08:00
parent f2e557e77f
commit 476bf863f2
No known key found for this signature in database
GPG key ID: 760127DAE4EDD351
4 changed files with 5 additions and 4 deletions

View file

@ -48,7 +48,6 @@
"github/no-then": "off",
"import/no-extraneous-dependencies": "off",
"no-shadow": "off",
"no-throw-literal": "off",
"no-useless-escape": "off",
"sort-imports": "off"
}

2
lib/upload-lib.js generated
View file

@ -34,7 +34,7 @@ function combineSarifFiles(sarifFiles) {
combinedSarif.version = sarifObject.version;
}
else if (combinedSarif.version !== sarifObject.version) {
throw `Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`;
throw new Error(`Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`);
}
combinedSarif.runs.push(...sarifObject.runs);
}

File diff suppressed because one or more lines are too long

View file

@ -26,7 +26,9 @@ export function combineSarifFiles(sarifFiles: string[]): string {
if (combinedSarif.version === null) {
combinedSarif.version = sarifObject.version;
} else if (combinedSarif.version !== sarifObject.version) {
throw `Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`;
throw new Error(
`Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`
);
}
combinedSarif.runs.push(...sarifObject.runs);