Repository navigation
noImplicitAny rule applied to external packages #8883
Description
I was trying out the new angular ui router which has been ported to TypeScript and ships with definitions in the box. However, it looks like the compiler rules for my own project are being applied to the angular ui router project as well.
TypeScript Version:
1.8.10
Code
import { StateProvider } from "angular-ui-router";Using this tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"module": "es2015",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": true,
"preserveConstEnums": true,
"removeComments": false,
"sourceMap": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es2015"
}
}Expected behavior:
StateProvider is pulled in and can be used. No errors.
Actual behavior:
It errors with:
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\ng1\viewDirective.d.ts
(10,9): error TS7010: 'resolve', which lacks return-type annotation, implicitly has an 'any' return type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\hof.d.ts
(113,27): error TS7006: Parameter 'ctor' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\hof.d.ts
(113,37): error TS7006: Parameter 'x' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\hof.d.ts
(115,27): error TS7006: Parameter 'comp' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\hof.d.ts
(115,37): error TS7006: Parameter 'x' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\state\stateBuilder.d.ts
(3,54): error TS7006: Parameter 'parent' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\transition\transitionServ
ice.d.ts
(75,35): error TS7006: Parameter 'error' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\common.d.ts
(13,37): error TS7006: Parameter 'X' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\common.d.ts
(163,63): error TS7006: Parameter 'T' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\common.d.ts
(163,66): error TS7006: Parameter 'key' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\common.d.ts
(165,71): error TS7006: Parameter 'T' implicitly has an 'any' type.
ERROR in C:\source\poorclaresarundel\PoorClaresAngular\node_modules\angular-ui-router\commonjs\common\common.d.ts
(165,74): error TS7006: Parameter 'key' implicitly has an 'any' type.
All of these are external to my own project; I wouldn't have expected that this would be an issue. As it happens the good folks of angular ui router are planning to remedy this. But if, for whatever reason, they didn't then I'd either have to change the choices made in my own project to align with theirs or not use their project. Neither of those is great.
Would a compiler option that restricts applying these rules to external projects be something you might consider? Whilst packages that ship with typings in the box is at the moment relatively niche I can imagine that changing massively over time.
Activity
basarat commentedon May 30, 2016
I believe the newly introduced
skipLibCheckoption does exactly that 🌹johnnyreilly commentedon May 30, 2016
Thanks Basarat Ali Syed (@basarat)! - I hadn't heard of that option; is that part of 1.8 or is it slated for 2.0?
johnnyreilly commentedon May 30, 2016
I see it - 2.0. thanks! https://github.com/Microsoft/TypeScript/wiki/Roadmap
johnnyreilly commentedon May 30, 2016
Will close as it looks like this is resolved by #8735
basarat commentedon May 30, 2016
John Reilly (@johnnyreilly) ↪️ I've made an
almrelease0.0.87that supports this option 🌹johnnyreilly commentedon May 30, 2016
I would expect nothing less 😄 🌷