Skip to content

svelte-check not ignoring excluded files in certain cases. #2430

@ptrxyz

Description

@ptrxyz

Describe the bug

According to the docs, svelte-check should ignore files that are excluded by tsconfig.json.
However this is not always working when using bun as a package manager and linked packages.

Reproduction

  1. create an external package: mkdir /tmp/my-pkg/ && cd /tmp/my-pkg && bun init .
  2. add some non-sense to the index.ts to trigger an error: echo 'ThisIsWrong' > index.ts
  3. make the package available on the host machine: bun link
  4. create a new svelte project: mkdir /tmp/app && cd /tmp/app && bun create svelte@latest; (use skeleton project and enable Typescript)
  5. add the external reference: bun link my-pkg && bun install
  6. reference the external package: echo 'import * from "my-pkg"' > src/lib/index.ts
  7. add exclude: [ "my-pkg/**", "../my-pkg/**", "my-pkg", "node_modules/" ] to your tsconfig.json
  8. run bun run check and see it fail caused by the error in our external package ("/tmp/app/../my-pkg/index.ts").

Expected behaviour

svelte-check should ignore the errors in the file since they match the pattern in tsconfig's exclude list.

System Info

  • OS: Linux
  • IDE: VSCode

Which package is the issue about?

svelte-check

Additional Information, eg. Screenshots

  • I didn't make a repository, since this requires two packages to demonstrate. Please follow the commands above.
  • I dug a bit into this and it seems that here the files of the external package are still in the list of files to be checked.
  • To my understanding, here is where it is decided if we check the file or not. I don't know if this happened earlier in the code maybe but I think this is where the files should be removed. Or even better, maybe in L198 already?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions