use module aliases vs relative paths#3683
Open
DukeManh wants to merge 1 commit into
Open
Conversation
Contributor
|
Search tests will fail while I'm updating ES |
Kevan-Y
approved these changes
Oct 6, 2022
Comment on lines
+18
to
+26
| "paths": { | ||
| "@components/*": ["components/*"], | ||
| "@hooks/*": ["hooks/*"], | ||
| "@styles/*": ["styles/*"], | ||
| "@theme": ["theme/index"], | ||
| "@translations/*": ["translations/*"], | ||
| "@config": ["config"], | ||
| "@interfaces": ["interfaces/index"] | ||
| } |
Contributor
There was a problem hiding this comment.
(nit): I personally prefer using like @/components/* instead of @components/*. So it doesn't get confused if we have a external package like @components
Contributor
There was a problem hiding this comment.
I agree with @Kevan-Y here. I also use the @/components/* for module aliases
Contributor
Author
|
We'd need to fix #3690 first to pass eslint. |
Contributor
|
@DukeManh do you want this in before tonight (end of Hacktoberfest)? If so, what does it need? |
Contributor
Author
ghost
approved these changes
Nov 15, 2022
ghost
left a comment
There was a problem hiding this comment.
This looks good!
The only nit-picky thing that might be considered, that some projects prefer the scoped package inports to be between the "traditional" library imports and the relative imports for readability reasons.
a51adae to
94eec21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the project grows deeper, more
../are required in the relative import paths to import modules so this configs TS path aliases, that map to certain absolute paths.Type of Change
Description
Steps to test the PR
Checklist