-
Notifications
You must be signed in to change notification settings - Fork 198
Support for typed rules? #294
Comments
Yes, it is already supported. See: https://github.com/palantir/tslint/blob/master/src/rules/noForInArrayRule.ts You need to get the Program object in your rule and then the TypeChecker object in your walker. |
Sorry, I was a little vague in the issue - does tslint-microsoft-contrib support having typed rules? Is there documentation for adding a typed rule here? |
There is no documentation, but I think you just do exactly what noForInArrayRule is doing. You can use that rule as a template. Basically, having a typed rule gives you access to the TypeChecker object. YOu can see the API in typescript.d.ts:
|
There are a whole bunch of rules that we should convert to use this instead of what we do today. |
Thanks - I am actually familiar with the new APIs; I'd asked here because I sent in a couple PRs to main tslint for issues that were filed under tslint-microsoft-contrib. |
Does tslint-microsoft-contrib have support for the new type checker rules? If not, how difficult would it be to add it in?
The text was updated successfully, but these errors were encountered: