language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

chore: remove undocumented filePathsToIgnore option

Open benmccann opened this issue 1 year ago • 4 comments

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

benmccann avatar Jun 26 '24 03:06 benmccann

@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.

dummdidumm avatar Jun 26 '24 15:06 dummdidumm

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

benmccann avatar Jun 26 '24 15:06 benmccann

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

dummdidumm avatar Jun 26 '24 17:06 dummdidumm

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.

jasonlyu123 avatar Jun 27 '24 01:06 jasonlyu123

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 avatar Jul 03 '24 11:07 dummdidumm

@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

benmccann avatar Jul 04 '24 18:07 benmccann

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.

dummdidumm avatar Jul 04 '24 18:07 dummdidumm

ohhh. I see. I misunderstood this code and searched for filePathsToIgnore. thanks!

benmccann avatar Jul 04 '24 22:07 benmccann