Skip to content

Commit 3688d85

Browse files
committed
fix: add missing license information to the tooltip
1 parent 5d5bbbc commit 3688d85

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/annotatePackageJson.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,18 @@ export function createPackageJsonDependencyAnnotator(): Disposable {
178178
tooltip.appendMarkdown(`- **Compatibility:** ${compatibility.join(', ')}\n`);
179179
}
180180

181+
tooltip.appendMarkdown(`- **Directory score:** ${lib.score}/100\n\n`);
182+
183+
if (lib.github.license) {
184+
tooltip.appendMarkdown(`- **License:** ${lib.github.license.spdxId}\n\n`);
185+
}
186+
181187
if (lib.unmaintained && lib.alternatives && lib.alternatives.length > 0) {
182-
tooltip.appendMarkdown(`- **Alternatives:** \`${lib.alternatives.join(', ')}\`\n`);
188+
tooltip.appendMarkdown(`- **Alternatives:** \`${lib.alternatives.join(', ')}\`\n\n`);
189+
} else {
190+
tooltip.appendMarkdown('\n');
183191
}
184192

185-
tooltip.appendMarkdown(`- **Directory score:** ${lib.score}/100\n\n`);
186193
tooltip.appendMarkdown(getDetailLabel(lib, true));
187194
tooltip.appendMarkdown(`\n\n---\n`);
188195
tooltip.appendMarkdown(`[React Native Directory](https://reactnative.directory/package/${lib.npmPkg}) 🞄 `);

0 commit comments

Comments
 (0)