-
Notifications
You must be signed in to change notification settings - Fork 44
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
type definitions for gulp-tslint dont work with typescript #124
Comments
I'll release 8.1.0 today, which will contain some changes to the types: #119 - maybe that will help here. EDIT: published, can you try again? You could also try |
Hi Panu, it didn't work for me, TS still can't resolve an interface with a default function definition, even though it should work and TS doesn't complain about the definition at all. |
What do you mean by node style module loader for typescript? Can you link to a repository which exhibits the problem? |
Hi again, ok here's an example app that demonstrates the problem: https://github.com/damon-at-sportsbet/types-test-gulp-tslint if you check out that project and run I have had some discussion with people and had it explained to me why this is such a nightmare to do in a nice way. If you want I can try to explain that here too. |
Ok for now I guess I'm going to have to fork this project. Shame. |
I'm not sure how this is possible, but the built in type definitions for gulp-tslint itself don't work for me when trying to use a typescript gulpfile.
A lot of libraries that export a function that has members on it, like, say, mkdirp, or express, use a method where they define a function and then a namespace with the same name. The function defines the exported function and the namespace defines any members that are also on that function. This process seems to work.
The strategy that gulp-tslint uses is this:
export interface TslintPlugin {
(pluginOptions?: PluginOptions): any;
report: (options?: ReportOptions) => any;
}
which absolutely should work, but doesn't seem to actually work for us, perhaps it's because we are using the node style module loader for typescript?
Anyway, the type definitions from definitelyTyped, that are now available as the npm package @types/gulp-tslint do seem to work for me so I wonder if you can just take those ones and use them?
gulp-tslint version: 8.0.0
tslint version: 5.0.0
Operating system: MacOS
Example gulp configuration (if applicable):
gulpfile.txt
Error console output:
gulpfile.ts (140,10): Cannot invoke an expression whose type lacks a call signature. Type 'typeof "/Users/damons/Work/Sportsbet/hydra/node_modules/gulp-tslint/index"' has no compatible call signatures. (2349)
gulpfile.ts (141,15): Property 'report' does not exist on type 'typeof "/Users/damons/Work/Sportsbet/hydra/node_modules/gulp-tslint/index"'. (2339)
TypeScript example code (if applicable):
The text was updated successfully, but these errors were encountered: