Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

Allow type checking (fixes #67) #73

Closed
wants to merge 1 commit into from
Closed

Allow type checking (fixes #67) #73

wants to merge 1 commit into from

Conversation

bgold09
Copy link
Contributor

@bgold09 bgold09 commented Apr 22, 2017

  • Providing typeCheck: true in the options for the task will create
    a TypeScript program instance to be used during linting.

fixes #67

  * Providing `typeCheck: true` in the options for the task will create
    a TypeScript program instance to be used during linting.
@DirtyHairy
Copy link

What's the status here?

Copy link
Contributor

@adidahiya adidahiya left a 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 @@
{
Copy link
Contributor

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

Copy link
Contributor Author

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)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor Author

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

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.

@schaable
Copy link

what's the status of this? would be great to have typeCheck available as an option

@Eddman Eddman mentioned this pull request Mar 7, 2018
@bgold09
Copy link
Contributor Author

bgold09 commented Apr 10, 2018

Closing in favor of #77

@bgold09 bgold09 closed this Apr 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable type checking
5 participants