question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for jsconfig.json

See original GitHub issue

When I create an application with “create react app” then it places all source under the /src directory. In that case, imports do not have a “src/” prefix. However, importjs will produce import paths that do have the “src/” prefix. Is it possible to fix this? Or am I doing something wrong?

I thought that one option could be to take the value of compilerOptions.baseUrl in the jsconfig.json file into account when determining the import paths.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
coagmanocommented, Jun 11, 2020

I’ve gotten around it by putting the package.json and node_modules in /src, which doesn’t work for create react app…

Should be relatively easy to add to here: https://github.com/Galooshi/import-js/blob/master/lib/findProjectRoot.js

If you wanted to start a proposal

0reactions
mniebercommented, Oct 28, 2021

FYI, I’m now using the vandelay plugin in VSCode to generate the import statements. It doesn’t have the “Fix all imports” feature that ImportJS has, which is very useful, but otherwise works really well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jsconfig.json Reference - Visual Studio Code
The jsconfig. json file specifies the root files and the options for the features provided by the JavaScript language service.
Read more >
What is jsconfig.json? - javascript - Stack Overflow
The jsconfig. json file specifies the root files and the options for the features provided by the JavaScript language service.
Read more >
jsconfig.json - npm
Small tool which automatically generates jsconfig.json, used for vscode workspace configuration, with defaults and paths from webpack config ...
Read more >
jsconfig.json - GitHub
Small tool which automatically generates jsconfig.json, used for vscode workspace configuration, with some defaults and extracted webpack path aliases.
Read more >
Why you need a jsconfig.js when using VSCode - Laravel News
VSCode uses a jsconfig.json file to aid your JavaScript language service and significantly improve your development experience.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found