Unresolved type for dynamic module.exports
Hey!
I wonder how i can resolve dynamic exports with IntelliJ IDEA latest.
File: a.js
obj = {
something: 'something'
}
_.each(obj, function(value, key) {
module.exports[key] = value;
});
File: b.js
a = require('a')
a.something
a.something shows "Unresolved type something".
Thank you.
Please sign in to leave a comment.
no way; such exports can't be resolved during static code analysis.
Any workaround/ideas?
the only possible workaround is creating typescript stubs for your library
Elena Pogorelova
Sorry to up that old thread but could you please provide a concrete sample on how to create a typescript stub for the upper "a.js" and "b.js" files ?
I'm not used to typescript and didn't figured that out by myself after a few search on the subject.