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

Building tsc projects with noImplicitAny can't find lodash types. #7

Open
knowuh opened this issue Feb 7, 2018 · 1 comment
Open

Comments

@knowuh
Copy link

knowuh commented Feb 7, 2018

Hello,

Thank you for schema-based-json . It's exactly what I need at the moment.

I ran into something when using strict noImplicitAny rules in tsconfig.js. I can work around this, but thought I should bring it up, incase it is something which you can address in future releases.

I hope this is enough information to help you.

Cheers!

Version(if relevant): 1.0.0

7.2.1

Environment(if relevant):

webpack 3.10
awesome-typescript-loader 3.1
typescript 2.5.2

Code(if relevant):

→ schema-based-json-editor/dist/index.d.ts:

import * as toNumber from "lodash.tonumber";
import * as toInteger from "lodash.tointeger";

→ tsconfig.json

{
  "compilerOptions": {
    "outDir": "./dist",
    "sourceMap": true,
    "declaration": true,
    "noImplicitAny": true,   ⬅
    "module": "commonjs",
    "moduleResolution": "node",
    "target": "es5",
    "lib": ["es6", "dom"],
    "jsx": "react",
    "strictNullChecks": true
  },
  "include": [ "src/**/*"]
}
    webpack

Expected:

Build without errors

Actual:


ERROR in [at-loader] ./node_modules/schema-based-json-editor/dist/index.d.ts:1:27
    TS7016: Could not find a declaration file for module 'lodash.tonumber'. '/Users/npaessel/lab/cc/model-feedback/node_modules/lodash.tonumber/index.js' implicitly has an 'any' type.
  Try `npm install @types/lodash.tonumber` if it exists or add a new declaration (.d.ts) file containing `declare module 'lodash.tonumber';`

ERROR in [at-loader] ./node_modules/schema-based-json-editor/dist/index.d.ts:2:28
    TS7016: Could not find a declaration file for module 'lodash.tointeger'. '/Users/npaessel/lab/cc/model-feedback/node_modules/lodash.tointeger/index.js' implicitly has an 'any' type.
  Try `npm install @types/lodash.tointeger` if it exists or add a new declaration (.d.ts) file containing `declare module 'lodash.tointeger';`

@plantain-00
Copy link
Owner

v7.2.4 should fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants