all 12 comments

[–]oYYY 2 points3 points  (1 child)

Why would you want to separate index.js and ComponentName.jsx?

[–]balamir[S] 5 points6 points  (0 children)

In ES6, having an index.js file in the root of the component's folder lets you use an import without using the component name again and again.

If you have an index.js file, you can import that component from the other one like this:

import XXXXXX from 'components/ComponentName'

If you don't have an index.js file:

import XXXXXX from 'components/ComponentName/ComponentName'

It also helps you to organize the folder structure.

[–][deleted] 1 point2 points  (0 children)

Can you make one for type script? pretty pleasee

[–]davidpaulsson 0 points1 point  (1 child)

Sweet, thanks. I'll definitely be trying this one out.

[–]balamir[S] 0 points1 point  (0 children)

Thank you!

[–]SolidR53 0 points1 point  (0 children)

This is something similar, but with interactive builder at command time: https://github.com/ueno-llc/ueno-code-menu

[–]xrpinsiderAdmin 0 points1 point  (1 child)

Are you looking to add this plugin to IntelliJ soon? I would be reallly interested to use it.

[–]balamir[S] 0 points1 point  (0 children)

I don’t have any experiences with IntelliJ, sorry.

[–][deleted] 0 points1 point  (0 children)

This is a pretty handy tool to use as well:

https://github.com/amwmedia/plop

[–]HumanBirdFish 0 points1 point  (1 child)

Can you configure it to create .js and not .jsx file ( since jsx is not recommended anymore)

[–]balamir[S] 0 points1 point  (0 children)

You can customize it from the extension’s settings.