import * as config from 'config'
console.log(config.hogehoge)
と書くと、
TS2339: Property 'hogehoge' does not exist on type 'IConfig'
とエラーが出てしまう。コンパイルはできるけどエラー表示は消したい。
config.get()を使うと
TS1259: Module '"D:\\node_modules\\@types\\config\\index"' can only be default-imported using the 'esModuleInterop' flag
と別のエラーになってしまう。
ひとまずの対処で
import * as config from 'config'
const myConfig: any = config
console.log(myConfig.hogehoge)
ウーン、代入しなおすしかないのか...