-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint: no-inferrable-types for a declared type #7549
Comments
This is actually working as intended according to eslint's definition of function fn(a: number = 5, b: boolean = true) {} So the idea of this lint is that even types in signatures should be removed when they are trivially inferrable from a literal value. There is an |
Thanks for the clarification @solson ! That makes sense haha. If only I hadn't included Deno as a hardcoded search term I might've ended up on eslint's docs 😅. Update: lol, this is now on the first page of google for deno + inferrable-types so I guess there's something good about my poor googling skills leading to this issue hahaha 🥳 |
Hello!
Currently when running
deno lint --unstable
I get some issues withno-inferrable-types
on fields that I'm actually declaring the type and then assigning a value.For instance the following snippet causes the output from deno lint:
Even tho the
lint
option is flagged asunstable
I was unable to find this reported elsewhere so hopefully this is just a duplicate and this is a know issue 😅You can find the failing snippet on this GitHub repository, just nevermind the
no-explicit-any
(as those are intended by me right now 😅)The text was updated successfully, but these errors were encountered: