Fix rest eslint errors manually

This commit is contained in:
Kenichi Kamiya
2022-07-04 20:12:07 +09:00
parent 6e9189a5c1
commit 9fdc2574b8
2 changed files with 5 additions and 13 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import {Change, ChangeSchema} from './schemas' import {Change} from './schemas'
/** /**
* Loops through a list of changes, filtering and returning the * Loops through a list of changes, filtering and returning the
+4 -12
View File
@@ -58,7 +58,7 @@ async function run(): Promise<void> {
) )
if (licenseErrors.length > 0) { if (licenseErrors.length > 0) {
printLicensesError(licenseErrors, licenses) printLicensesError(licenseErrors)
core.setFailed('Dependency review detected incompatible licenses.') core.setFailed('Dependency review detected incompatible licenses.')
} }
@@ -90,7 +90,7 @@ async function run(): Promise<void> {
} }
} }
function printChangeVulnerabilities(change: Change) { function printChangeVulnerabilities(change: Change): void {
for (const vuln of change.vulnerabilities) { for (const vuln of change.vulnerabilities) {
core.info( core.info(
`${styles.bold.open}${change.manifest} » ${change.name}@${ `${styles.bold.open}${change.manifest} » ${change.name}@${
@@ -117,19 +117,11 @@ function renderSeverity(
return `${styles.color[color].open}(${severity} severity)${styles.color[color].close}` return `${styles.color[color].open}(${severity} severity)${styles.color[color].close}`
} }
function printLicensesError( function printLicensesError(changes: Change[]): void {
changes: Change[], if (changes.length === 0) {
licenses: {
allow?: string[]
deny?: string[]
}
): void {
if (changes.length == 0) {
return return
} }
const {allow = [], deny = []} = licenses
core.info('\nThe following dependencies have incompatible licenses:\n') core.info('\nThe following dependencies have incompatible licenses:\n')
for (const change of changes) { for (const change of changes) {
core.info( core.info(