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

Fix/ADF-1166/ESlint errors in core/moduleLoader, also fix a wrong use of dynamic import #158

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

jsconan
Copy link
Contributor

@jsconan jsconan commented Oct 17, 2022

Related to: https://oat-sa.atlassian.net/browse/ADF-1166

Summary

Fix the ESLint error in core/moduleLoader.
Fix the wrong use of the dynamic import which was not returning anything (look at the changed code, it was surely not properly working).

Note: as the changes are pretty heavy, I split them all into several pull requests.

Details

This pull request only targets the core/moduleoader part of the library.
The full picture can be seen from the main branch which contains all the fixes: https://github.com/oat-sa/tao-core-sdk-fe.git#fix/ADF-1166/eslint-errors

What has been made:

  • replace arguments with the rest operator
  • replace var with const or let (but not in all places, only in the touched files when it was not adding too much noise)
  • apply object shorthand instead of duplicated function names
  • apply arrow functions here and there when it helped, but not systematically to reduce the noise
  • fix the wrong usage of dynamic import as its return value was not properly managed
  • remove ESLint complain regarding the dynamic import

How to test

  • checkout and install the source code npm i
  • run the linter: npm run lint:src, errors and warnings coming from the core/moduleLoader folder should have gone.
  • run the linter: npm run lint:test, errors and warnings coming from the core/moduleLoader folder should have gone.
  • run the unit tests: npm run test core
  • install with other repositories, using the following scheme: "@oat-sa/tao-core-sdk": "https://github.com/oat-sa/tao-core-sdk-fe.git#fix/ADF-1166/eslint-errors",, then checking the unit tests and playing with TAO

@jsconan jsconan requested a review from shaveko October 17, 2022 14:43
@github-actions
Copy link

github-actions bot commented Oct 17, 2022

Coverage Report

Totals Coverage
Statements: 90.48% ( 2633 / 2910 )
Methods: 94.97% ( 604 / 636 )

Copy link
Contributor

@shaveko shaveko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! import issue is fixed

@github-actions
Copy link

Version

Target Version 1.20.2
Last version 1.20.1

There are 0 BREAKING CHANGE, 0 feature, 1 fix

@jsconan jsconan merged commit 1873cc2 into develop Oct 26, 2022
@jsconan jsconan deleted the fix/ADF-1166/module-loader-wrong-import branch October 26, 2022 06:59
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

Successfully merging this pull request may close these issues.

None yet

2 participants