question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

extends... in jsconfig causes warnings in editors

See original GitHub issue

Describe the bug

VSCode gives type warnings in vanilla js

Removing the following from jsconfig.json fixes this:

"extends": "./.svelte-kit/tsconfig.json"

This shouldn’t happen if you are not using typescript.

Reproduction

Create a brand new SvelteKit project, skeleton, no typescript. Add following to index.svelte

<script>
    import { session } from '$app/stores'
</script>

{$session.lang}

VSCode will now mark lang with a warning/error saying Property 'lang' lang does not exist on type 'Session'

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
    Memory: 13.28 GB / 31.71 GB
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (99.0.1150.46)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.33
    @sveltejs/kit: next => 1.0.0-next.302
    svelte: ^3.44.0 => 3.46.4

Severity

annoyance

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Rich-Harriscommented, Apr 4, 2022

Cross-posting from #4495:


I almost wonder if we need to have two separate prompts when setting up a project, where if you don’t opt in to TypeScript-the-language you can still opt in to typechecking:

? Use TypeScript? › Yes
? Use TypeScript? › No
? Add typechecking for JavaScript? › No / Yes

Personally I would choose No and Yes, but I don’t know if I’m in a sufficiently small minority that that would be annoying for most non-TypeScript users.

0reactions
Rich-Harriscommented, Apr 25, 2022

We can close this now, as jsconfig.json is only generated if you choose ‘Type-checked JavaScript’ when scaffolding the project, and the extended config doesn’t include checkJs (it’s part of the default jsconfig.json if you opt in)

Read more comments on GitHub >

github_iconTop Results From Across the Web

jsconfig.json Reference - Visual Studio Code
The jsconfig. json file specifies the root files and the options for the features provided by the JavaScript language service.
Read more >
Decorators error in VS code editor after upgrading to Angular 10
The reason for this is that for that specific file TypeScript doesn't see experimentalDecorators option.
Read more >
Javascript - vscode-docs
If your project has a jsconfig. json file, then make sure that typings is contained in the project context defined by the location...
Read more >
TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >
How to configure Prettier and VSCode - Gleb Bahmutov
You can use Prettier from command line, or from your code editor whenever ... For some reason, VSCode can use globally installed extension ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found