If I create a project using ‘deno init’ then the Language Server (and therefore VS Code) can type-check code that uses Deno KV by default. (Though it won’t run unless you enable Deno KV, since it’s an unstable API.)
If I create a new Fresh project then it doesn’t work.
The reason for this is the reference declarations at the top of main.ts. To enable type checking for unstable API’s, turning on unstable API’s in either VS Code’s settings or in deno.json doesn’t work. You need to edit main.ts and add a reference declaration.
(Actually the reference declaration can be anywhere, but main.ts is the logical place to put it.)
This seems needlessly obscure. My suggestion: enable type-checking for unstable API’s by default. There is still another step to actually use them, but this is more consistent with non-Fresh projects and with the ‘deno check’ command.
If I create a project using ‘deno init’ then the Language Server (and therefore VS Code) can type-check code that uses Deno KV by default. (Though it won’t run unless you enable Deno KV, since it’s an unstable API.)
If I create a new Fresh project then it doesn’t work.
The reason for this is the reference declarations at the top of main.ts. To enable type checking for unstable API’s, turning on unstable API’s in either VS Code’s settings or in deno.json doesn’t work. You need to edit main.ts and add a reference declaration.
(Actually the reference declaration can be anywhere, but main.ts is the logical place to put it.)
This seems needlessly obscure. My suggestion: enable type-checking for unstable API’s by default. There is still another step to actually use them, but this is more consistent with non-Fresh projects and with the ‘deno check’ command.