Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
report(
`Missing JSDoc @${targetTagName}.`,
null,
jsdocParameter,
);
} else if (allowedLicenses) {
if (allowedLicenses !== true && !allowedLicenses.includes(license)) {
report(
`Invalid JSDoc @${targetTagName}: "${license}"; expected one of ${allowedLicenses.join(', ')}.`,
null,
jsdocParameter,
);
}
} else {
try {
spdxExpressionParse(license);
} catch (error) {
report(
`Invalid JSDoc @${targetTagName}: "${license}"; expected SPDX expression: https://spdx.org/licenses/.`,
null,
jsdocParameter,
);
}
}
});