Skip to content

Commit 175a755

Browse files
feat: add duplicate detection for tags in package.json
1 parent c624c88 commit 175a755

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/expand_module_list_with_repo_data.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,14 @@ async function addInformationFromPackageJson (moduleList) {
101101
"smart mirror"
102102
];
103103

104-
module.tags = moduleData.keywords
104+
module.tags = moduleData.keywords;
105+
106+
const duplicates = module.tags.filter((tag, index) => module.tags.indexOf(tag) !== index);
107+
if (duplicates.length > 0) {
108+
module.issues.push(`There are duplicates in the keywords in your package.json: ${duplicates.join(", ")}`);
109+
}
110+
111+
module.tags = module.tags
105112
.map((tag) => {
106113
tag = tag.toLowerCase();
107114
if (tag === "smarthome") {

0 commit comments

Comments
 (0)