Skip to content

noImplicitAny rule applied to external packages #8883

Closed

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

  1. basarat commented on May 30, 2016

    @basarat
    Contributor

    Would a compiler option that restricts applying these rules to external projects be something you might consider

    I believe the newly introduced skipLibCheck option does exactly that 🌹

  2. johnnyreilly commented on May 30, 2016

    @johnnyreilly
    Author

    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?

  3. johnnyreilly commented on May 30, 2016

    @johnnyreilly
    Author
  4. johnnyreilly commented on May 30, 2016

    @johnnyreilly
    Author

    Will close as it looks like this is resolved by #8735

  5. basarat commented on May 30, 2016

    @basarat
    Contributor

    John Reilly (@johnnyreilly) ↪️ I've made an alm release 0.0.87 that supports this option 🌹

  6. johnnyreilly commented on May 30, 2016

    @johnnyreilly
    Author

    I would expect nothing less 😄 🌷

  7. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions