BioDrop icon indicating copy to clipboard operation
BioDrop copied to clipboard

[OTHER] Suggestion - Add path aliases

Open FrozenHearth opened this issue 3 years ago • 6 comments

What would you like to share?

Right now, we are having to manually specify the directory path in this way:

import xyz from "../../../components/XYZComponent"

With aliasing using jsconfig.json file, we can clean up the import syntax, and do something like,

import xyz from 'components/XYZComponent'

Next.js supports it out of the box: https://nextjs.org/docs/advanced-features/module-path-aliases

Additional information

No response

FrozenHearth avatar Jan 16 '23 20:01 FrozenHearth

It's great having you contribute to this project

Welcome to the community :nerd_face:

If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord chat and our GitHub Organisation - we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.

github-actions[bot] avatar Jan 16 '23 20:01 github-actions[bot]

Anyone wants to take up this issue? CC @ManishBisht777 @eddiejaoude

FrozenHearth avatar Jan 30 '23 19:01 FrozenHearth

I can take this up.

FrozenHearth avatar Feb 01 '23 22:02 FrozenHearth

Great idea @FrozenHearth - I will assign this to you.

SaraJaoude avatar Feb 05 '23 03:02 SaraJaoude

Thanks @SaraJaoude ! Just a question; do you recommend I ONLY add the jsconfig file OR additionally also make changes to all files to replace ../../components with @/components

FrozenHearth avatar Feb 05 '23 18:02 FrozenHearth

Thanks @SaraJaoude !

Just a question; do you recommend I ONLY add the jsconfig file OR additionally also make changes to all files to replace ../../components with @/components

I think it would be great to have it all moved over in this pull request

eddiejaoude avatar Feb 06 '23 07:02 eddiejaoude

This has now been completed

eddiejaoude avatar Apr 03 '23 07:04 eddiejaoude