I am working with FeathersJS and TypeScript. As it is still under development (TS for Feathers) I found that I need to override types for that to be able to adjust to my case (e.g. pagination can be disabled or enabled and types should handle it but don't at the moment).
In my tsconfig.json I have the following:
"typeRoots": [ /* List of folders to include type definitions from. */
"./types",
"node_modules/@types"
],
The order does not matter as I have tried with node_modules first too.
I put the folder feathersjs__feathers
in ./types
with just index.d.ts
(removed package.json
) with exact copy of the types from DefinitelyTyped.
This line is causing the issue: import * as self from '@feathersjs/feathers';
TS7016 could not find a declaration file for module '@feathersjs/feathers'. 'C:/Users/marek/dev/system/api — kopia/node_modules/@feathersjs/feathers/lib/index.js' implicitly has an 'any' type. Try
npm install @types/feathersjs__feathers
if it exists or add a new declaration (.d.ts) file containingdeclare module 'feathersjs__feathers';
I have tried to add the package.json
to my folder, like that:
{
"name": "@types/feathersjs__feathers",
"version": "0.0.1",
"types": "index.d.ts"
}
but it does not help with that issue.
If I install @types/feathersjs__feathers
so it is there in node_modules
there is no error, but no matter what order in typeRoots
it takes types from that types, not from my override.
Any solutions for that?
Generally the config with ./types
and folders with index.d.ts
is fine as e.g. for feathers-mongoose
I have my own typings there and they are working properly. The issue is just with importing self...