Disambiguate TypeScript with tsx extension. (#3464)

Using the technique as discussed in #2761.
This commit is contained in:
Eloy Durán
2017-02-20 11:17:18 +01:00
committed by Colin Seymour
parent b66fcb2529
commit f1be771611
7 changed files with 1868 additions and 27 deletions

View File

@@ -465,5 +465,13 @@ module Linguist
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