Hey there! I'm currently in the process of converting my JavaScript React Redux project to TypeScript, and I've decided to kick things off by tackling my redux reducers file.
Here's a snapshot of how my project is structured:
Project/
...
reducers/
index.ts
actions/
index.js
types/
actions/
index.d.ts
...
tsconfig.js
Content of reducers/index.ts:
import { Actions } from "../actions";
When I use this code, I encounter the following error:
[ts] Could not find a declaration file for module '../actions'
In my types/actions/index.d.ts file, I have the following declaration:
declare module "actions";
Within my tsconfig.js file, these are my compiler options:
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"jsx": "react",
"strict": true,
"typeRoots": ["./types", "./node_modules/@types"],
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"exclude": ["node_modules", "typings"]
}
I'm unsure about how to resolve the error message: [ts] Could not find a declaration file for module '../actions'