Skip to content
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

Consider using the language server type information for rules #805

Open
kitsonk opened this issue Aug 19, 2021 · 1 comment
Open

Consider using the language server type information for rules #805

kitsonk opened this issue Aug 19, 2021 · 1 comment
Labels
request Feature request

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Aug 19, 2021

We would want to think carefully about it, but we might want to consider using the language server, in some fashion, to provide type information in certain scenarios for certain rules. Possibly keeping it behind a flag. The language server can provide very specific type information at particular points in the code which could make rules like no-fallthrough, and undeclared globals more accurate. When using linting in the editor, the language server is already running, so there is little cost overhead, though a deno lint would have the cost of the tsc start up.

I would think that we would only do a type query when we "think" a diagnostic is being produced, but we want to do final validation. Like we "think" there is fall through in a case statement, but we see a function call at the end, so we quickly check with the language server the return type of the function.

Ping @magurotuna @dsherret

@kitsonk kitsonk added the request Feature request label Aug 19, 2021
@magurotuna
Copy link
Member

Sounds like a great idea, being able to acquire type information would solve a bunch of problems we've had for a long time.
It seems a good compromise to query type info only when diagnostics are likely produced. I think another option would be adding some tag to the rules that require type information, and then running deno lint --quick would skip the rules tagged with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants