extends... in jsconfig causes warnings in editors
See original GitHub issueDescribe 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:
- Created a year ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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:
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.
We can close this now, as
jsconfig.jsonis only generated if you choose ‘Type-checked JavaScript’ when scaffolding the project, and the extended config doesn’t includecheckJs(it’s part of the defaultjsconfig.jsonif you opt in)