scalvert / ember-cli-checkup

An Ember CLI addon that provides health check information about your application, engine, or addon.
MIT License
7 stars 1 forks source link

chore(types): don't smash globby types #15

Closed chriskrycho closed 5 years ago

chriskrycho commented 5 years ago

globby now supplies its own type definitions, which the existing module definition was invisibly smashing; removing it allows the native types shipped with the package to work correctly.

rwjblue commented 5 years ago

Thank you!

scalvert commented 5 years ago

I'm surprised this passes, TBH. This was specifically added because globby's types were erroring out on compilation. I'd looked at this with @mike-north and we determined this was the only reasonable course to unblock us. I'll check again, but I'm again surprised.

chriskrycho commented 5 years ago

Curious. Possibly it’s because it was expecting the * as style import you later changed it to? That’s the only thing I can see based on the changes on the file searcher module.

rwjblue commented 5 years ago

We should also confirm that we properly fail CI on type errors...

mike-north commented 5 years ago

Curious. Possibly it’s because it was expecting the * as style import you later changed it to? That’s the only thing I can see based on the changes on the file searcher module.

the esModuleInterop stuff was causing trouble when Steve and I looked at this. We should also avoid using this flag in libraries, because it and the related allowSyntheticDefaultImports are effectively viral options, in that it's very easy to get into a situation where consumers are forced to also enable them.

rwjblue commented 5 years ago

the esModuleInterop stuff was causing trouble when Steve and I looked at this.

FWIW, you can use the alternative format to work with module.exports = someActualThing;:

import Thing = require('whatever');

This avoids needing to use the esModuleInterop flag.

mike-north commented 5 years ago

import Thing = require('whatever');

This is equivalent to

import * as Thing from 'whatever';
chriskrycho commented 5 years ago

Aye import thing = require works, but 🤮. And teaching it to users is a thing I at least would rather avoid.