feat(ci): json files should not be in root

This commit is contained in:
William Harrison committed 2024-12-09 11:00:53 +08:00
1 parent 3bd87b2da0
commit 61ed491666
1 file changed
+11
+11
View File
@@ -93,3 +93,14 @@ t("All files should have valid optional fields", (t) => {
}
});
});
const ignoredJSONFiles = [
"package-lock.json",
"package.json"
]
t("JSON files should not be in the root directory", (t) => {
const files = fs.readdirSync(path.resolve()).filter((file) => file.endsWith(".json") && !ignoredJSONFiles.includes(file));;
t.is(files.length, 0, "JSON files should not be in the root directory");
});