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

grunt-tslint runs again all the files with newer #67

Closed
mvidailhet opened this issue Jan 7, 2015 · 4 comments
Closed

grunt-tslint runs again all the files with newer #67

mvidailhet opened this issue Jan 7, 2015 · 4 comments

Comments

@mvidailhet
Copy link

My grunt-ts config:

        tslint: {
            options: {
                configuration: grunt.file.readJSON("tslint.json")
            },
            all: {
                src: ["app.ts", "**/*.ts", "!node_modules/**/*.ts"]
            }
        },

If I run newer:tslint:all in my watch task, it still runs again all the ts files.

@tschaub
Copy link
Owner

tschaub commented Jan 9, 2015

@mvidailhet could you publish a repository that I could clone to reproduce this problem? Or a gist with enough files to easily get things set up.

@mvidailhet
Copy link
Author

Hi @tschaub,

I'm so sorry, but I actually meant grunt-tslint and not grunt-ts.

For the 2 issues you linked, seems that the answer lies in the "fast" option of grunt-ts. The fast options actually allows to recompile only changed files (like grunt-newer does).

If you specify a "out" directory in grunt-ts with the fast option set to "watch" (default), it always runs against all the files saying: "Fast compile will not work when --out is specified. Ignoring fast compilation".

If you do the same with the fast option set to "never" (default) and use newer, it will output this message:
"Warning: In task "build", either "files" or "out" should be used - not both."
I think that's why it wouldn't work for the issues #43 and #38

I've made a repository showing the problem with the out directory here: https://github.com/mvidailhet/grunt-ts-newer

But if you don't specify a "out" directory, "newer" or the fast compile from grunt-ts both only run against changed file as expected.

Hope that helped.

@mvidailhet
Copy link
Author

For the jslint part, I found the problem. grunt-newer doesn't write cache files if there are errors (logic).
My files had lint errors so that's why newer was always running against all the files.

@tschaub tschaub changed the title grunt-ts runs again all the files with newer grunt-tslint runs again all the files with newer Jan 11, 2015
@tschaub
Copy link
Owner

tschaub commented Jan 11, 2015

Thanks for the extra detail @mvidailhet. So it sounds like we can close this as invalid regarding grunt-tslint. Indeed the newer task uses the last successful run time when filtering source files.

If you could leave any comments for grunt-ts users on the other tickets, that would be great. I'm not a grunt-ts user, so I'm not certain whether the issues are still valid (a change in grunt-newer would help) or not (grunt-ts config will help).

@tschaub tschaub closed this as completed Jan 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants