-
-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Thank you for submitting a pull request! We appreciate the time and effort you have invested in making these changes. Please ensure that you provide enough information to allow others to review your pull request. Upon submission, your pull request will be automatically assigned with reviewers. If you want to learn more about contributing to this project, please visit: https://github.com/web-infra-dev/rspack/blob/main/CONTRIBUTING.md. --> ## Summary Related #4348 Added resolve hint diagnostics. prefer-relative: ``` ERROR in ./index.js × Resolve error: Can't resolve 'foo.js' in '<PROJECT_ROOT>/tests/diagnostics/factorize/prefer-relative-resolve-suggestions' ╭──── 1 │ import "foo.js"; · ──────── ╰──── help: Did you mean './foo.js'? Requests that should resolve in the current directory need to start with './'. Requests that start with a name are treated as module requests and resolve within module directories (node_modules). If changing the source code is not an option, there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too. ``` fully-specified: ``` ERROR in ./index.js × Resolve error: Can't resolve './foo' in '<PROJECT_ROOT>/tests/diagnostics/factorize/fully-specified-resolve-suggestions' ╭──── 1 │ import "./foo"; · ─────── ╰──── help: Did you mean './foo.js'? The request './foo' failed to resolve only because it was resolved as fully specified, probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"'. The extension in the request is mandatory for it to be fully specified. Add the extension to the request. ``` <!-- Can you explain the reasoning behind implementing this change? What problem or issue does this pull request resolve? --> <!-- It would be helpful if you could provide any relevant context, such as GitHub issues or related discussions. --> ## Test Plan See snapshot diagnostic changes: - rspack/tests/diagnostics/factorize/fully-specified-resolve-suggestions - rspack/tests/diagnostics/factorize/prefer-relative-resolve-suggestions Other snapshot changes are caused by "error.separator!". <!-- Can you please describe how you tested the changes you made to the code? --> ## Require Documentation? <!-- Does this PR require documentation? --> - [x] No - [ ] Yes, the corresponding rspack-website PR is \_\_
- Loading branch information
Showing
39 changed files
with
388 additions
and
127 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
a3f7ec1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Benchmark detail: Open