Incompatible with Deno 1.4.[0,1,2] due to deno adopting tsconfig settings importsNotUsedAsValues and isolatedModules
See original GitHub issueIn version 1.4 Deno adopted;
- ~the tsconfig setting importsNotUsedAsValues - https://github.com/denoland/deno/pull/7413~ This seems to have been reverted in deno 1.4.5, and it appears they aren’t planning on making it a default anymore https://github.com/denoland/deno/pull/7800
- the tsconfig setting isolatedModules when using the deno
--unstable
flag - https://github.com/denoland/deno/issues/7326 (intended to be enabled by default in 1.5)
These require the use of;
- type only imports for values which are only used as types (
importsNotUsedAsValues
) - type only exports for types which are re-exported (
isolatedModules
)
From the errors I’m seeing with our tool which makes use of yargs from deno, this will require updates to the types for yargs, y18n and yargs_parser along the following lines.
# https://deno.land/x/y18n@v5.0.0-deno/deno.ts:2:1
- import { Y18NOpts } from './build/lib/index.d.ts'
+ import type { Y18NOpts } from './build/lib/index.d.ts'
# https://deno.land/x/yargs@v16.0.3-deno/types.ts#L6
// expose types for the benefit of Deno.
- import { YargsInstance as YargsType, Arguments } from './build/lib/yargs-factory.d.ts'
+ import type { YargsInstance as YargsType, Arguments } from './build/lib/yargs-factory.d.ts'
- export {
+export type {
Arguments,
YargsType
}
While there is a possible workaround of overriding these in a custom tsconfig, from 1.5 deno have indicated they will ignore any custom value for importsNotUsedAsValues from 1.5 onwards https://github.com/denoland/deno/pull/7413#issuecomment-691127947.
I’ll open Pull Requests for these shortly, just getting the repos setup locally.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Use isolatedModules · Issue #7326 · denoland/deno - GitHub
Incompatible with Deno 1.4.[0,1,2] due to deno adopting tsconfig settings importsNotUsedAsValues and isolatedModules yargs/yargs#1771.
Read more >Configuration | Manual - Deno
To use a TypeScript configuration file with Deno, you have to provide a path on the command line. For example: > deno run...
Read more >Typescript Import Problem after updating Deno - Stack Overflow
Setting tsconfig like this will solve the problem { "compilerOptions": { "importsNotUsedAsValues": "remove", "isolatedModules": false, } }.
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
@luke-john let’s make the changes for now, without switching CI/CD to unstable – since it unblocks you.
Then we’ll just be mindful as v1.5 comes out.
@luke-john whoops, slight issue with:
https://github.com/yargs/yargs-parser/pull/329
Mind recreating the PR with the PR being against
master
. Thedeno
branch is automatically generated whenever we perform a release.