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

Chevrotain fails to compile with Typescript and noImplicitAny #459

Closed
ibdknox opened this issue Apr 28, 2017 · 3 comments
Closed

Chevrotain fails to compile with Typescript and noImplicitAny #459

ibdknox opened this issue Apr 28, 2017 · 3 comments

Comments

@ibdknox
Copy link

ibdknox commented Apr 28, 2017

Here are the errors:

node_modules/chevrotain/lib/chevrotain.d.ts(698,42): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
node_modules/chevrotain/lib/chevrotain.d.ts(698,67): error TS7006: Parameter 'T' implicitly has an 'any' type.
node_modules/chevrotain/lib/chevrotain.d.ts(751,39): error TS7006: Parameter 'number' implicitly has an 'any' type.
node_modules/chevrotain/lib/chevrotain.d.ts(770,40): error TS7006: Parameter 'number' implicitly has an 'any' type.
node_modules/chevrotain/lib/chevrotain.d.ts(774,40): error TS7006: Parameter 'number' implicitly has an 'any' type.
node_modules/chevrotain/lib/chevrotain.d.ts(778,40): error TS7006: Parameter 'number' implicitly has an 'any' type.
node_modules/chevrotain/lib/chevrotain.d.ts(782,40): error TS7006: Parameter 'number' implicitly has an 'any' type.
node_modules/chevrotain/lib/chevrotain.d.ts(786,40): error TS7006: Parameter 'number' implicitly has an 'any' type.
node_modules/chevrotain/lib/chevrotain.d.ts(1123,47): error TS7006: Parameter 'number' implicitly has an 'any' type.

I fixed them in my local copy of chevrotain.d.ts but I don't see how/where you are generating that file here.

Here's my fixed version: https://gist.github.com/ibdknox/47efe725ea4f99cafac90dbe34b6e4ae

@bd82
Copy link
Member

bd82 commented Apr 28, 2017

Thanks for reporting this.

The chevrotain.d.ts file is created by concatenating the public API definitions.
https://github.com/SAP/chevrotain/blob/830d3677228a61ffcf2a3c985ff19aa36ba7c574/gruntfile.js#L246
As there is no need to expose the none public APIs in the definitions.

I'll have a look at enabling the strict option in the the recently released TypeScript 2.3
https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#new---strict-master-option

This will cause the most strict compilation possible and thus the definitions should be compatible
regardless of which subset of the optional compilation flags are enabled.

bd82 pushed a commit that referenced this issue Apr 28, 2017
@bd82 bd82 closed this as completed in #461 Apr 28, 2017
@bd82
Copy link
Member

bd82 commented Apr 28, 2017

fix will be included in 0.28.2 which should finish the release process in a few minutes.

@ibdknox
Copy link
Author

ibdknox commented Apr 28, 2017

Awesome. Thanks for the quick fix!

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