lib/linguist/heuristics.rb in github-linguist-5.0.5 vs lib/linguist/heuristics.rb in github-linguist-5.0.6
- old
+ new
@@ -463,7 +463,15 @@
# Heads up - we don't usually write heuristics like this (with no regex match)
else
Language["Scilab"]
end
end
+
+ disambiguate ".tsx" do |data|
+ if /^\s*(import.+(from\s+|require\()['"]react|\/\/\/\s*<reference\s)/.match(data)
+ Language["TypeScript"]
+ elsif /^\s*<\?xml\s+version/i.match(data)
+ Language["XML"]
+ end
+ end
end
end