check-dts: Error when project has JavaScript files

If a project has JavaScript files (jest.config.js, for example), they are used in the check as well as TypeScript ones, which leads to errors. This pattern includes the JavaScript files: https://github.com/ai/check-dts/blob/c3ceea25aab9603c0a704126dfc7cd74401d1097/check.js#L67 all variable contains the files because of the pattern: https://github.com/ai/check-dts/blob/c3ceea25aab9603c0a704126dfc7cd74401d1097/check.js#L81 Then, the library tries to get errors from the files: https://github.com/ai/check-dts/blob/c3ceea25aab9603c0a704126dfc7cd74401d1097/check.js#L99 And inevitably fails at this point: https://github.com/ai/check-dts/blob/c3ceea25aab9603c0a704126dfc7cd74401d1097/check.js#L110 The error message is “TypeError: Cannot read property ‘text’ of undefined”.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

The codes are different (6504 || 6054). One is for JS without allowJs. Another for non-JS unsupported code (like JSON).

The fix was released in 0.5.5