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

No implicit any errors #15

Open
timruffles opened this issue Mar 27, 2017 · 0 comments
Open

No implicit any errors #15

timruffles opened this issue Mar 27, 2017 · 0 comments

Comments

@timruffles
Copy link

timruffles commented Mar 27, 2017

I'm having the following errors:

 ERROR in node_modules/@ngrx/core/src/compose.ts (12,43): Rest parameter 'functions' implicitly has an 'any[]' type.
  node_modules/@ngrx/core/src/compose.ts (13,19): Parameter 'arg' implicitly has an 'any' type.

when using this repo with: Typescript 2.2.2 and the below tsconfig. From looking at the code there is a type annotation, but TS seems to be failing at inferring the types from it.

I've not dug into best-practices for publishing TS modules, but is the lack of explicit declaration file in package.json, or a index.d.ts forcing TypeScript to dig through the package and re-validate it? I note the TypeScript docs suggests either types in package.json or a index.d.ts (the approach Angular itself takes).

{
  "compilerOptions": {
    "baseUrl": "",
    "declaration": false,
    "emitDecoratorMetadata": true,
    "skipLibCheck": true,
    "noImplicitAny": true,
    "noEmitHelpers": true,
    "importHelpers": true,
    "strictNullChecks": false,
    "noImplicitReturns": false,
    "noImplicitThis": false,
    "forceConsistentCasingInFileNames": true,
    "experimentalDecorators": true,
    "lib": ["es2016", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  }
}
timruffles added a commit to timruffles/core that referenced this issue Mar 31, 2017
Since this module is designed to be compiled by consumer projects (from what I can tell - see ngrx#15), it's nice to turn on noImplicitAny.

The compose function had a signature, but tsc didn't seem to be able to infer the argument types. I've added them, and checked that
`ComposeSignature` is still the type consumers see.

Fixes ngrx#15.
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

Successfully merging a pull request may close this issue.

1 participant