{"action":"created","issue":{"url":"https://api.github.com/repos/github/linguist/issues/3067","repository_url":"https://api.github.com/repos/github/linguist","labels_url":"https://api.github.com/repos/github/linguist/issues/3067/labels{/name}","comments_url":"https://api.github.com/repos/github/linguist/issues/3067/comments","events_url":"https://api.github.com/repos/github/linguist/issues/3067/events","html_url":"https://github.com/github/linguist/issues/3067","id":161096710,"number":3067,"title":"TypeScript file misidentified as JavaScript","user":{"login":"jamesrichford","id":8244919,"avatar_url":"https://avatars.githubusercontent.com/u/8244919?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesrichford","html_url":"https://github.com/jamesrichford","followers_url":"https://api.github.com/users/jamesrichford/followers","following_url":"https://api.github.com/users/jamesrichford/following{/other_user}","gists_url":"https://api.github.com/users/jamesrichford/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesrichford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesrichford/subscriptions","organizations_url":"https://api.github.com/users/jamesrichford/orgs","repos_url":"https://api.github.com/users/jamesrichford/repos","events_url":"https://api.github.com/users/jamesrichford/events{/privacy}","received_events_url":"https://api.github.com/users/jamesrichford/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-19T23:01:13Z","updated_at":"2016-06-21T17:00:14Z","closed_at":"2016-06-21T17:00:13Z","body":"Hey there,\r\n\r\nJust noticed one of my repos is reporting JavaScript in it, thought this was a bit curious as may have left something in by mistake but seems like an issue.\r\n\r\nThe repo in question is https://github.com/jamesrichford/alsatian\r\n\r\nand this search https://github.com/jamesrichford/alsatian/search?l=javascript\r\n\r\nresults in this file being returned https://github.com/jamesrichford/alsatian/blob/a981398cb2b624e282a70b0d62cbf5c09c82fb30/cli/alsatian-cli.ts\r\n\r\nlooks like it may be to do with the line ```#! /usr/bin/env node``` as this is the only thing different about this file.\r\n\r\nLet me know if you need any more information.\r\n\r\nThanks!!! (PS ace work everyone involved, github has so many neat features :) Love it!)\r\n"},"comment":{"url":"https://api.github.com/repos/github/linguist/issues/comments/227504067","html_url":"https://github.com/github/linguist/issues/3067#issuecomment-227504067","issue_url":"https://api.github.com/repos/github/linguist/issues/3067","id":227504067,"user":{"login":"arfon","id":4483,"avatar_url":"https://avatars.githubusercontent.com/u/4483?v=3","gravatar_id":"","url":"https://api.github.com/users/arfon","html_url":"https://github.com/arfon","followers_url":"https://api.github.com/users/arfon/followers","following_url":"https://api.github.com/users/arfon/following{/other_user}","gists_url":"https://api.github.com/users/arfon/gists{/gist_id}","starred_url":"https://api.github.com/users/arfon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arfon/subscriptions","organizations_url":"https://api.github.com/users/arfon/orgs","repos_url":"https://api.github.com/users/arfon/repos","events_url":"https://api.github.com/users/arfon/events{/privacy}","received_events_url":"https://api.github.com/users/arfon/received_events","type":"User","site_admin":true},"created_at":"2016-06-21T17:00:13Z","updated_at":"2016-06-21T17:00:13Z","body":"@jamesrichford - yes it's [this line](https://github.com/jamesrichford/alsatian/blob/a981398cb2b624e282a70b0d62cbf5c09c82fb30/cli/alsatian-cli.ts#L1) that's causing the issue here.\r\n\r\nOne of the strategies we use when trying to detect the language of a file is to see if we can detect a shebang: https://github.com/github/linguist/blob/master/lib/linguist.rb#L62\r\n\r\nThere are a couple of possible fixes here:\r\n\r\n1. Set a modeline in your file (the modeline strategy runs before the shebang one) https://github.com/github/linguist#using-emacs-or-vim-modelines\r\n2. Set the language in a `.gitattributes` file https://github.com/github/linguist#using-gitattributes\r\n\r\n@pchaigno @larsbrinkhoff it's [this line](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml#L1813-L1814) that's causing the issue here. I'm wondering if we should remove this given that the popularity of `TypeScript` is only likely to increase."}}
{"actor":{"display_login":"arfon"}}