If you are a strict developer like me, use something like Airbnb’s ESLint config. This means the auto-import mechanism uses absolute imports. There won’t no warnings and autocomplete/ jump-to-source will work. Now WebStrom knows where the absolute imports are pointing. Then check the Use paths relative to the project, resource or sources roots. Now go to Settings -> Editor -> Code Style -> JavaScript and select the Imports tab. Select the option Mark Directory as and then select the Resources Root option. Select the src folder in the project window and right-click on it. Therefore, you can follow the above process. Intellisense and jump-to-source are just working fine with absolute imports. VS Code is smart enough to understand the tsconfig.json, or jsconfig.json file. Here I am going to mention the progress for the top 2 IDEs. Well, no… You need to make your IDE smart to understand absolute imports in your files. What if your project’s folder structure is complex, and you need to go up in it? Inside of your components, you have imports that look like the below example with relative imports.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |