Skip to content

Commit 48eb347

Browse files
committed
fix: exclude .ts and .tsx as xml extensions
1 parent 874b8c6 commit 48eb347

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

bin/languages.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

33
import { writeFileSync } from "node:fs";
4-
import linguistLanguages from "linguist-languages";
4+
import * as linguistLanguages from "linguist-languages";
55
import { format } from "prettier";
66
import packageJSON from "../package.json" with { type: "json" };
77

@@ -16,8 +16,14 @@ function getSupportLanguages() {
1616
// manually-maintained list. These two had been added manually. So in the
1717
// interest of not breaking anything, we'll add them back in here.
1818
if (language.name === "XML") {
19-
language.extensions?.push(".inx", ".runsettings");
20-
language.extensions?.sort();
19+
let extensions = language.extensions;
20+
if (extensions) {
21+
extensions.push(".inx", ".runsettings");
22+
config.extensions = extensions
23+
// https://github.com/github-linguist/linguist/pull/1842
24+
.filter((e) => ![".ts", ".tsx"].includes(e))
25+
.sort();
26+
}
2127
}
2228

2329
supportLanguages.push({

0 commit comments

Comments
 (0)