Closed daniel-agouveia closed 1 year ago
I have added the declarations files in latest version.
In your tsconfig.app.json
, add the paths property to the compilerOptions.
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"paths": {
"scratchcard-js": ["./node_modules/scratchcard-js/types/scratchcard-js.d.ts"]
},
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
}
I have added the declarations files in latest version.
In your
tsconfig.app.json
, add the paths property to the compilerOptions.{ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", "paths": { "scratchcard-js": ["./node_modules/scratchcard-js/types/scratchcard-js.d.ts"] }, }, "files": [ "src/main.ts" ], "include": [ "src/**/*.d.ts" ] }
Thank you for reply!
I noticed this error Could not find a declaration file for module 'scratchcard-js'. 'directory/node_modules/scratchcard-js/build/scratchcard.min.js' implicitly has an 'any' type.
This happens when trying to import { SCRATCH_TYPE, ScratchCard } from 'scratchcard-js'; in Angular 13, the only workaround I found was to add "noImplicitAny": false in my tsconfig.json file inside the compiler options. Why is this happening? All other libraries work without issues.