Skip to content

vscode_deno behaves differently from deno check in a certain situation #1337

@gnlow

Description

@gnlow

Describe the bug

  • In current setting, deno check behaves as expected, vscode_deno does not.
  • doing one of belows make both behave as expected
    • add top level ./deno.json with { "compilerOptions": {} }
    • remove ./web/deno.json
    • remove ./web/tsconfig.json

To Reproduce

.
├── mod.ts
└── web
    ├── deno.json     `` (empty)
    └── tsconfig.json `{ "include": ["../**/*"] }`
class Person {
    name = "MyName"
    sayName() {
        console.log(this.name)
    }
}

const me = new Person()
const sayName = me.sayName.bind(me)

sayName("mistake!") // expected error

Expected behavior

  • type of sayName in ./mod.ts correctly inferred as () => void
  • thus show error Expected 0 arguments, but got 1.
  • type of .bind():
CallableFunction.bind<() => void>(this: () => void, thisArg: unknown): () => void
Image

Actual behavior

  • type of sayName in ./mod.ts inferred as any
  • thus doesn't show error
  • type of .bind():
Function.bind(this: Function, thisArg: any, ...argArray: any[]): any
Image

Versions

$ code --version
1.105.0
03c265b1adee71ac88f833e065f7bb956b60550a
x64

$ code --list-extensions --show-versions | grep deno
denoland.vscode-deno@3.45.2

$ deno --version
deno 2.5.4 (stable, release, x86_64-pc-windows-msvc)
v8 14.0.365.5-rusty
typescript 5.9.2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions