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

Add ES6 support (migrate from module.exports to export const) #9

Open
reubenae opened this issue Sep 10, 2020 · 5 comments
Open

Add ES6 support (migrate from module.exports to export const) #9

reubenae opened this issue Sep 10, 2020 · 5 comments
Labels
question Further information is requested

Comments

@reubenae
Copy link
Contributor

reubenae commented Sep 10, 2020

At the moment we use module.exports in this repo occasionally, for example here https://github.com/intuit/user-data-for-fraud-prevention/blob/master/src/js/index.js#L6 . It would be better to have ES6 style export const ... instead.

A stack overflow on this topic https://stackoverflow.com/questions/40294870/module-exports-vs-export-default-in-node-js-and-es6 likely this will require some babel configuration.

Tutorial https://egghead.io/lessons/javascript-how-to-write-a-javascript-library-adding-es6-support

This can be tested with using yarn-link locally.

@reubenae reubenae changed the title Migrate from module.exports to export const Add ES6 support (migrate from module.exports to export const) Sep 11, 2020
@christyjacob4
Copy link
Contributor

christyjacob4 commented Sep 24, 2020

Hey @reubenae I'd like to take this up
I wen't through the code and saw that we're already using export const in

  • src/js/common/browserInfoHelper.js
  • src/js/common/globalsUtil.js
  • src/js/hmrc/mtdFraudPrevention.js

@reubenae
Copy link
Contributor Author

Good point. This issue could have been written better, the specific location I'd like to remove (if possible) is here: https://github.com/intuit/user-data-for-fraud-prevention/blob/master/src/js/index.js#L6

I will amend the description of the issue, thanks for taking a look!

@jitinmaher
Copy link
Contributor

Hi @reubenae , can I take this up?

@reubenae
Copy link
Contributor Author

reubenae commented Oct 1, 2020

@jitinmaher you are free to submit a PR, and we appreciate the contribution. We do not allow people to "claim" issues in advance as its too tricky to manage.

Please make sure to test this with the demo project listed in the README.md using yarn link or npm link

@reubenae
Copy link
Contributor Author

reubenae commented Oct 1, 2020

We're not sure here #45 - this needs more research done, so I recommend not working on this issue yet (unless you have a really good understanding of this sort of thing and can bring the repo maintainers up to speed!)

@reubenae reubenae added question Further information is requested and removed GraceHopperOSD hacktoberfest labels Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants