import config from '../config.js'
src/main.ts:3:20 - error TS7016: Could not find a declaration file for module '../config.js'. 'path/config.js' implicitly has an 'any' type.
1
sechi 2023-03-15 14:00:05 +08:00
把 config.js 改成 config.ts 呗
|
2
hua123s 2023-03-15 14:04:07 +08:00
写一个 config.d.ts 呗,不然就 ts-ignore
|
3
wdssmq OP AI 给了条命令,姑且备忘下 - -
tsc --allowJs --declaration --outDir ./typings config.js |
5
wdssmq OP |
6
wdssmq OP tsconfig 配置了 "allowJs": true, 好像可以了
|