Skip to content

Fix for noImplicitAny: make them explicit any refs #1925

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

Closed
wants to merge 5 commits into from

Conversation

catull
Copy link
Contributor

@catull catull commented Aug 31, 2016

Some references in packages/base-href-webpack-plugin.spec.ts have implicit type any.
This is not allowed in the config of TypeScript compiler.
Thus all these references must be made explicit any types.

Similarly to issue #1876, this time the build fails with:

npm run build

> [email protected] build /Users/carlo/workspace/javascript/ng/angular-cli.git
> npm-run-all -c build:main build:packages


> [email protected] build:main /Users/carlo/workspace/javascript/ng/angular-cli.git
> tsc -p addon/ng2


> [email protected] build:packages /Users/carlo/workspace/javascript/ng/angular-cli.git
> for PKG in packages/*; do echo Building $PKG...; tsc -P $PKG; done

Building packages/ast-tools...
Building packages/base-href-webpack...
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(5,23): error TS7006: Parameter 'indexHtml' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(5,34): error TS7006: Parameter 'callback' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(7,23): error TS7006: Parameter 'event' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(7,30): error TS7006: Parameter 'compilerCallback' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(9,27): error TS7006: Parameter 'hook' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(9,33): error TS7006: Parameter 'compilationCallback' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(32,42): error TS7006: Parameter 'x' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(32,45): error TS7006: Parameter 'htmlPluginData' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(40,42): error TS7006: Parameter 'x' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(40,45): error TS7006: Parameter 'htmlPluginData' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(58,13): error TS7006: Parameter 'x' implicitly has an 'any' type.
packages/base-href-webpack/src/base-href-webpack-plugin.spec.ts(58,16): error TS7006: Parameter 'htmlPluginData' implicitly has an 'any' type.

This PR fixes the compilation errors.

catull added 2 commits August 31, 2016 21:54
…licit type any. This is not allowed in the config of TypeScript compiler. Thus all these references must be made explicit any types.
…gular#1987)

* fix(find-lazy-modules): Allow for any valid keys/value to be used
and properly understand and return the modules in this case.

Also refactored that function to be clearer, and added a test to cover.
I made sure the test was failing before this PR ;)

Fixes angular#1891, angular#1960.

cc @filipesilva @ericjim @chalin - See similar
angular#1972

* cleanup
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@googlebot googlebot added cla: no and removed cla: yes labels Sep 6, 2016
@catull
Copy link
Contributor Author

catull commented Sep 6, 2016

Indeed, I authored these changes.

When I check the log, commit 71670ae clearly states the origin.

@catull
Copy link
Contributor Author

catull commented Sep 6, 2016

Merges from Pull Requests do not always show the exact origins, I noticed in this particular project.

However small the contribution may be, it is also possible that someone other than me, came up with the same fix in a possibly larger Pull Request.

@catull
Copy link
Contributor Author

catull commented Sep 6, 2016

At any rate, the change is in, that's all the counts.

* update awesome-typescript-loader and compiler-cli to accommodate changes in TS 2.0.0+
@hansl
Copy link
Contributor

hansl commented Sep 10, 2016

This PR seems out of date now with the latest changes. Also, we do not want to force noImplicitAny on generated apps, just on the CLI itself.

I'm going to close this PR as most of its content is already in master.

As for the CLA bot, it gets confused sometimes. I can still merge without its accord, so just comment that you agree with the terms and I will ignore it.

Cheers!

@hansl hansl closed this Sep 10, 2016
@catull catull deleted the fix-no-implicit-any branch September 10, 2016 20:36
@catull
Copy link
Contributor Author

catull commented Sep 10, 2016

No problem, close it.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
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.

4 participants