Hey all, I just swapped a few packages over to ESM and I get the, expected, error __dirname is not defined in ES module scope. I swapped over to defining __dirname myself using dirname and fileURLToPath as noted all over. However now I want TS to enforce this.
I have @types/node installed as a dependency and noticed
var __filename: string;
var __dirname: string;
Are both declared in globals.d.ts.
Is there a way to tell TS to remove these from the global scope? Or maybe there is another @types package for node-esm? I would just like to enforce that __dirname needs to be defined in code now.
thanks!