language-tools
language-tools copied to clipboard
chore: remove undocumented filePathsToIgnore option
ref https://github.com/sveltejs/language-tools/issues/2397
I did a search on GitHub and can't find anyone using this. If no one complains about it that will free us up to swap fast-glob with a lighter library. For now I left fast-glob in place, but we can follow up to remove it later on assuming no one misses this option
@jasonlyu123 do you remember why we ever added that? This probably predated the "load the tsconfig" times. I would be ok with removing it in the next svelte-check major.
When I searched all of GitHub for filePathsToIgnore I saw several other projects such as Astro with the same code. I'm guessing it was probably in some example that got copied
I think Astro did copy svelte-check for their initial iteration, probably just an oversight to not remove it - sounds like it's safe to remove in the next major then
filePathsToIgnore is the internal name for the --ignore option. Yeah. it predated the "load the tsconfig". We could probably just remove the ability for it to be a glob pattern and keep the option. The undocumented part should be that it, most likey unintentional, can be a glob pattern.
Did a quick github search, only one archived repository used a glob pattern. A bunch of others use it but without any patterns. @benmccann I'm therefore closing this PR, but feel free to open a new one that replaces the glob library with a simpler one that also fits our needs, as long as said library can deal with simple patterns (and we need to keep some form of it anyway because of our built-in ignores)
@dummdidumm could you share some example repos? I had done a search and couldn't find any consumers, so I'm not quite sure what patterns need to be supported
This is the search I did: https://github.com/search?q=%22svelte-check+--ignore%22+language%3Ajson&type=code . Only the pattern "starts with X" needs to be supported (the same we need internally, because of the "ignore node_modules") e.g. people write svelte-check --ignore dist and that means the whole dist folder should be ignored.
ohhh. I see. I misunderstood this code and searched for filePathsToIgnore. thanks!