subbed
subbed17h ago

deno check does not accept noImplicitReturns

hello. i have the following config inside deno.json:
{
"compilerOptions": {
"strict": true,
"noImplicitReturns": true
},
...
}
{
"compilerOptions": {
"strict": true,
"noImplicitReturns": true
},
...
}
running deno check still allows function signatures without the return type. how can i enforce the deno check to fail if no return type is present?
8 Replies
subbed
subbed17h ago
for example, deno check does not error on the following, even though the Response return type is not provided:
const rootHandler = (ctx: Context) => {
return ctx.json({ shade: "?", random: randomInt(0, 256) });
};
const rootHandler = (ctx: Context) => {
return ctx.json({ shade: "?", random: randomInt(0, 256) });
};
please ping me if you reply to this post, thank you
bartlomieju
bartlomieju12h ago
@subbed could you please open an issue in Deno repo about it? It looks like a bug
subbed
subbed12h ago
GitHub
deno check does not enforce noImplicitReturns · Issue #26265 · deno...
deno 2.0.0 (stable, release, x86_64-unknown-linux-gnu) v8 12.9.202.13-rusty typescript 5.6.2 deno check seemigly does not enforce the noImplicitReturns clause. Having the following deno.json snippe...
bartlomieju
bartlomieju12h ago
Thank you :deno_thankyou:
Danyil
Danyil11h ago
as temporary workaround you can use biome.js along with deno lint
subbed
subbed11h ago
i have used biome for quite a while now. regardless, it is an additional config file on the root, so a fix would be appreciated
Danyil
Danyil11h ago
as i said, temporary
subbed
subbed11h ago
correct, and as i said, i have been using it thus far. thank you for your recommendation regardless