-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
* Providing `typeCheck: true` in the options for the task will create a TypeScript program instance to be used during linting.
What's the status here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly looks good, but we should add support for configuring tsconfig.json
@@ -0,0 +1,5 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to add tsconfig.json
as a config option, just like the CLI tslint --project <filepath>
, and add one to this test scenario
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean so that we can pass the options to ts.createProgram()
in the task (line 68)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, I'll work on that addition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect the code here would not work when you're type checking a file, but you have definitions defined in a .d.ts file somewhere that wasn't passed to createProgram.
Here's how they called createProgram in tslint: https://github.com/palantir/tslint/blob/f22a3af28f2e3429ca223b0438b4a9b5b5ce0d62/src/linter.ts
I notice that in tslint they call createProgram once for all files, and create a single linter. Here it looks like grunt-tslint creates a linter and program for every file.
what's the status of this? would be great to have typeCheck available as an option |
Closing in favor of #77 |
typeCheck: true
in the options for the task will createa TypeScript program instance to be used during linting.
fixes #67