-
Notifications
You must be signed in to change notification settings - Fork 886
Lint Programs as a Whole #680
Comments
what additional features does this enable? we're not linting types yet anyway. |
Possibly stuff like this: #577 |
basically any rule that needs to inspect types will need all the type information from the compilation path in order to work reliably |
It'd at least be nice to pass a glob to |
@dallonf When using it programmatically I assume? (Since obviously a glob will work when using it via the CLI) |
Picking up @aleksey-bykov's comment, I wonder if we can kick start some sort of effort on this.... We have a long list of rules that we want to write (let's ignore the fact many of these rules should in fact be part of TypeScript core) @adidahiya @jkillian - are you aware of anyone who has tried to progress this? As @Aleksey-Bykov points out, the effort involve in creating a custom linter that does have type information is not hard. The more complicated bit will be working out how to integrate this into |
Sorry for the delayed response here @myitcv. I'm not aware of any progress on this so far, feel free to go for it if you have the time! I'm happy to discuss how we can integrate this kind of thing into TSLint as it is now |
How will this approach match the compiler options of tsc with those passed to tslint? For example, we need the same input files, same typings, same moduleResolution flag, same One option is to read tsconfig.json as an input to Another option is to work with the typescript team to run additional static analysis checks in the compiler itself, using some extensibility mechanism. |
@alexeagle - the approach we are following with As it stands, we only run Ultimately we could do away with the |
If the user will run a single program to type-check, run diagnostics, On Wed, Mar 30, 2016 at 11:13 AM Paul Jolly [email protected]
|
@alexeagle - completely agree. That would be ideal. I see you've already commented on the issue that I believe is tracking this in TypeScript core. Our work on |
Love it! |
Right now, TSLint lints files individually. This means that any information in one file (such as type information) is not available while linting other files.
One possible alternative is to, at startup, create a language services instance that has the source for the entire program and pass this to the rules. Full program information could then be used by the rules.
The text was updated successfully, but these errors were encountered: