mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-48934 Eslint v9 migration (#12110)
* update * update * update * working * cr * cr * update * use nx boundaries * fixes * fixes * fixes * cr * cr * update * update * update * cr * fix null * cr * cr * cr * cr * cr * update * update * update * update * update * remove some duplications * fix units
This commit is contained in:
@@ -101,6 +101,12 @@ function getPackageFile(packagePath: string): PackageInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a license expression to linked Markdown.
|
||||
*
|
||||
* @param rawExpression raw SPDX license expression
|
||||
* @returns expression with Markdown links
|
||||
*/
|
||||
function toLinkedLicenseExpression(rawExpression: string): string {
|
||||
return rawExpression.replace(/\*/g, '').replace(/[a-zA-Z0-9\-.]+/g, (match: string) => {
|
||||
const lowerMatch = match.toLowerCase();
|
||||
@@ -112,6 +118,14 @@ function toLinkedLicenseExpression(rawExpression: string): string {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the license page as Markdown.
|
||||
*
|
||||
* @param filteredPackages packages with license metadata
|
||||
* @param projName project name
|
||||
* @param projVersion project version
|
||||
* @returns rendered Markdown string
|
||||
*/
|
||||
function renderLicensePage(filteredPackages: Record<string, PackageInfoWithMetadata>, projName: string, projVersion: string): string {
|
||||
const rows = Object.entries(filteredPackages).map(([packageName, pack]) => {
|
||||
const lastAtSignPos = packageName.lastIndexOf('@');
|
||||
@@ -192,7 +206,6 @@ Options:
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.info(`Checking ${packagePath}`);
|
||||
const licenseScan = collectProductionLicenses(packagePath, {
|
||||
denyList: ['GPL'],
|
||||
@@ -223,7 +236,7 @@ Options:
|
||||
const outputFile = path.join(outputPath, `license-info-${packageJson.version}.md`);
|
||||
|
||||
fs.writeFileSync(outputFile, mdText);
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
console.log(`Report saved as ${outputFile}`);
|
||||
resolve(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user