[Typescript] Lookup for external modules in @types folder.#1526
Conversation
4 similar comments
JounQin
left a comment
There was a problem hiding this comment.
Great, didn't known about this option before.
|
@benmosher @ljharb any time to review this one liner? (and maybe while you're at it, also #1528. These two are breaking for TS users with the new |
ljharb
left a comment
There was a problem hiding this comment.
Any chance we could get a test for this?
|
@ljharb I assumed we didn't test configs, as there are no tests for any of them. The Happy to test that the config sets that setting? |
|
@joaovieira while that is quite true that we don't already (my bad) it's still better to add one, as if something's not tested, that tells me it's ok to break :-) |
f46dc45 to
64c0823
Compare
7cec495 to
34b1574
Compare
|
I'm not sure why the travis tests are failing; this test passes for me locally. |
d82d356 to
f134475
Compare
|
@ljharb fixed. Mocha doesn't seem to play nicely with globs. Decided to put the config tests next to all the others to simplify. |
f134475 to
ae747c0
Compare
Why
When using TypeScript an external module can be resolved to its type definition file located in
node_modules/@typesfromeslint-import-resolver-typescript@2.0.0. At the moment, that module would be marked as "internal" because the module is not found directly insidenode_modules, but instead nested inside@types.What
This PR just adds the
node_modules/@typesfolder to lookup for external modules when using the TypeScript config.Fixes #1525. Fixes #1541.