BeyondCodeBootcamp / js-with-types-jsdoc-tsc-starter

A simple, but non-trivial example of getting the most from JSDoc + tsserver (Type Linting without TypeScript)
Mozilla Public License 2.0
17 stars 1 forks source link

Gotcha: require('whatever').default #5

Closed coolaj86 closed 3 years ago

coolaj86 commented 3 years ago

In order to get the Type Linting to work properly in certain modules - such as axios, you have to change your require:

- let axios = require('axios');
+ let axios = require('axios').default;

Not sure where to put that in the docs...

coolaj86 commented 3 years ago

Found a spot: https://github.com/BeyondCodeBootcamp/jsdoc-typescript-starter/commit/75c65d3fbccfaf5cbd9ee3218954dc254095ace6