Problem with language stats even when using .gitattributes #6211
-
My problemHello, I currently have a repository and I'm having trouble with its language stats. The stats was originally 100% JavaScript, even though it should have been 100% TypeScript. I used the troubleshooting page on this repository to try and fix it, and then found out I can see which files are put in the statistics by clicking on the language of the repository and I did so, but another problem I found is that What I need to know
Extra notes:
Edit:Repository: https://github.com/recleun/wikisearch |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
As your repo stands, if you removed the So the reason you only saw JavaScript initially and needed to implement an override for your TypeScript file is because of the very first line in the file: This is a modeline indicating the interpreter of the file. With that said, I'm sure you can work out the answers I'm about to give to your questions…
Your
Remove the modeline or implement the override you did to force Linguist to ignore the modeline as I have done in my fork of your repo here - I'll delete this fork when we're done here. |
Beta Was this translation helpful? Give feedback.
As your repo stands, if you removed the
.gitattributes
file only two files will be considered by Linguist: the twoindex.*
files. Everything else is already ignored by default, though keep in mind clicking the language actually takes you to Search which doesn't ignore the files like Linguist does else you'd never find them.So the reason you only saw JavaScript initially and needed to implement an override for your TypeScript file is because of the very first line in the file:
#! /usr/bin/env node
.This is a modeline indicating the interpreter of the file.
node
is not a valid TypeScript interpreter and is thus only associated with JavaScript in Linguist, however modelines take precedence …