Skip to content

svelte-check --no-tsconfig checks TS/JS #1839

@fehnomenal

Description

@fehnomenal

Describe the bug

I want to only check svelte files and thus use svelte-check --no-tsconfig but it still loads the nearest tsconfig.json and checks TS/JS.

I added a log directly after parsing the options and this is what I got:

$ pnpm svelte-check --no-tsconfig
{
  _: [],
  tsconfig: false,
  workspace: undefined,
  output: 'human-verbose',
  watch: false,
  preserveWatchOutput: false,
  'no-tsconfig': false,
  ignore: undefined,
  'fail-on-warnings': false,
  'compiler-warnings': undefined,
  'diagnostic-sources': undefined,
  threshold: 'warning'
}

====================================
Loading svelte-check in workspace: /home/...
Getting Svelte diagnostics...

^CException: pnpm killed by signal interrupt
[tty 362], line 1: pnpm svelte-check --no-tsconfig

vs no flags:

$ pnpm svelte-check
{
  _: [],
  workspace: undefined,
  output: 'human-verbose',
  watch: false,
  preserveWatchOutput: false,
  tsconfig: undefined,
  'no-tsconfig': false,
  ignore: undefined,
  'fail-on-warnings': false,
  'compiler-warnings': undefined,
  'diagnostic-sources': undefined,
  threshold: 'warning'
}

====================================
Loading svelte-check in workspace: /home/...
Getting Svelte diagnostics...

^CException: pnpm killed by signal interrupt
[tty 363], line 1: pnpm svelte-check

As you can see no-tsconfig is always false and passing --no-tsconfig actually sets tsconfig to false instead of undefined.
And thus the early return in getTsconfig does not fire.

Reproduction

Well, call svelte-check --no-tsconfig in a project where there are type errors.

Expected behaviour

Do not display all the Typescript errors in .ts files.

System Info

  • OS: NixOS (Linux)
  • IDE: VSCodium

Which package is the issue about?

svelte-check

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions