Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript file with a cast fails to find any dependencies #64

Closed
esprehn opened this issue Oct 8, 2019 · 2 comments
Closed

TypeScript file with a cast fails to find any dependencies #64

esprehn opened this issue Oct 8, 2019 · 2 comments

Comments

@esprehn
Copy link

esprehn commented Oct 8, 2019

example.ts

import React from 'react';

export default class Example extends React.Component<any, any> {
  render() { 
    console.log(this as any);
    return null;
  }
}
$ precinct ./example.ts 
[]

If you remove the as any cast then:

$ precinct ./example.ts 
[ 'react' ]

This means that precinct misses imports in any file using casts in a function call.

ZhenyuCheng pushed a commit to ZhenyuCheng/node-precinct that referenced this issue Dec 2, 2019
Add support for a typescript configuration
@lo1tuma
Copy link

lo1tuma commented Dec 27, 2021

I’ve encountered the same issue. Maybe this is because detective-typescript still uses typescript v3 instead of v4.

@XhmikosR
Copy link
Member

v9.0.0 is out which updates detective-typescript to use Typescript 4.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants