Skip to content

Commit 382cbb9

Browse files
handle trailing commas while removing packages from at CI "oldest" tests
1 parent eb262de commit 382cbb9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

script/convert

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ gsub_file_content("../package.json", /"eslint-plugin-jest": "[^"]*",/, "")
2626
gsub_file_content("../package.json", /"globals": "[^"]*",/, "")
2727
gsub_file_content("../package.json", /"knip": "[^"]*",/, "")
2828
gsub_file_content("../package.json", /"publint": "[^"]*",/, "")
29-
gsub_file_content("../package.json", /"typescript-eslint": "[^"]*",/, "")
29+
gsub_file_content("../package.json", /"typescript-eslint": "[^"]*",?/, "")
3030
gsub_file_content("../package.json", %r{"@arethetypeswrong/cli": "[^"]*",}, "")
3131
gsub_file_content("../package.json", %r{"@eslint/compat": "[^"]*",}, "")
3232
gsub_file_content("../package.json", %r{"@testing-library/dom": "[^"]*",}, "")
3333
gsub_file_content("../package.json", %r{"@testing-library/react": "[^"]*",}, "")
3434

35+
# Clean up any trailing commas before closing braces
36+
gsub_file_content("../package.json", /,(\s*})/, "\\1")
37+
3538
# Switch to the oldest supported React version
3639
gsub_file_content("../package.json", /"react": "[^"]*",/, '"react": "16.14.0",')
3740
gsub_file_content("../package.json", /"react-dom": "[^"]*",/, '"react-dom": "16.14.0",')

0 commit comments

Comments
 (0)