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

configure a baseUrl #18

Open
bradrobertson opened this issue Jul 2, 2020 · 2 comments
Open

configure a baseUrl #18

bradrobertson opened this issue Jul 2, 2020 · 2 comments

Comments

@bradrobertson
Copy link

bradrobertson commented Jul 2, 2020

I'm using create-react-app and have a file like this in the root of my project:

{
  "compilerOptions": {
    "baseUrl": "src"
  }
}

So all of my imports look like

import { abc } from 'components/XYZ'

for a file in src/components/XYZ.js

Right now when I run deadfile it shows every single file as being dead.
eg:

673 total files found!
670 dead files found!
...

Is it possible to configure it so I can tell it the baseUrl is src?

Kudos on the lib btw, it looks really nicely put together!

@M-Izadmehr
Copy link
Owner

Hi @bradrobertson,
Thanks for creating this issue.
Unfortunately, deadfile currently supports:

  1. relative imports
  2. Babel-module-resolver
    But the following cases are not supported yet (I need to spend some time to implement them, or PRs are also highly appreciated):
  3. Webpack aliases
  4. Typescript base URL (your case)

@FezVrasta
Copy link

I tried to add a tsconfig.json file with the baseUrl config but this tool still can't seem to resolve the imports. Any idea?

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