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

chore: make import path consistent #1909

Merged
merged 16 commits into from
Jun 21, 2024
Merged

Conversation

shineli1984
Copy link
Collaborator

@shineli1984 shineli1984 commented Jun 17, 2024

Summary

Some clean up on import paths.

This is not to make it consistent once for all but mainly for people that try out different approaches to build our sdk, especially when touching baseurl or removing tsconfig files, won't be bogged down by fixing all the imports.

@shineli1984 shineli1984 marked this pull request as ready for review June 20, 2024 22:40
@shineli1984 shineli1984 requested review from a team as code owners June 20, 2024 22:40
@keithbro-imx
Copy link
Contributor

This is to make import path consistent across all packages.

Feel like I'm missing some context. What's the motivation here?

What is going to stop it becoming "inconsistent" again straight away?

@shineli1984
Copy link
Collaborator Author

@keithbro-imx
This is not to make it consistent once for all but mainly for people trying out different approach to build our sdk, especially when touching baseurl or removing tsconfig giles, they won't be bogged down by fixing all the imports.

@shineli1984 shineli1984 enabled auto-merge June 21, 2024 05:04
@zaidarain1
Copy link
Contributor

zaidarain1 commented Jun 21, 2024

Can we set up an eslint rule to only allow relative imports to ensure this remains fixed?

Package here
Rule here

Also is there any reason to still keep the tsconfig baseUrls?

@shineli1984
Copy link
Collaborator Author

shineli1984 commented Jun 21, 2024

@zaidarain1 the baseUrl is there because I want to do the test file separately in a different PR. they still use non-relative paths. also, that eslint rule is for absolute path tho. And I can't find a rule about "force relative path" in eslint.

@zaidarain1
Copy link
Contributor

@zaidarain1 the baseUrl is there because I want to do the test file separately in a different PR. they still use non-relative paths. also, that eslint rule is for absolute path tho. And I can't find a rule about "force relative path" in eslint.

@shineli1984

  "plugins": ["import"],
  "rules": {
    "import/no-unresolved": ["error"],

Running this rule with the above npm eslint-plugin-import packages errors out the imports for me as needed, but yeah the absolute path rule doesn't work.
image

@shineli1984 shineli1984 added this pull request to the merge queue Jun 21, 2024
Merged via the queue into main with commit 4927bc3 Jun 21, 2024
12 checks passed
@shineli1984 shineli1984 deleted the make-import-path-consistent branch June 21, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

8 participants