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

Update require statements in client-side code use impot/export syntax #1579

Open
naglepuff opened this issue Mar 26, 2025 · 0 comments
Open

Comments

@naglepuff
Copy link
Collaborator

We currently have some light mixing of ES6 style import/export syntax and common JS require. I'm specifically referring to the use of images for the study detail page:

images: {
// eslint-disable-next-line global-require
gold: require('@/assets/GOLD.png'),
// eslint-disable-next-line global-require
ess: require('@/assets/ESS.png'),
// eslint-disable-next-line global-require
massive: require('@/assets/massive.png'),
},

And the biosample detail page (see PR #1577).

I think it would be good to favor one style of imports over the other. The vast majority of our code base uses import/export, so we should update to statements like:

import gold from @/assets/gold.png

In order to appease typescript, we might also need to add a type declaration file so it knows how to treat these imports. Something like: https://stackoverflow.com/a/54137233

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

1 participant