You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like swc does not prioritize jsc.paths matches by length but instead chooses the first (re: arbitrary, since JSON objects are unsorted) that matches.
This is opposed to the behavior specified by tschere:
When multiple patterns match a module specifier, the pattern with the longest matching prefix before any * token is used
As far as I understand (zero rust experience, so please be forgiving), this can be rather easily fixed by sorting paths by index of * in tsc.rs.
I'm open to implementing it myself if that is indeed classified as bug that needs fixing.
)
**Description:**
See #8858
**BREAKING CHANGE:**
`jsc.paths` are now prioritized differently to align with `tsc`. The order is:
1. Exact matches
2. Wildcard pattern matches, sorted by length of prefix before wildcard
**Related issue:**
- Closes#8858
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
Seems like
swc
does not prioritizejsc.paths
matches by length but instead chooses the first (re: arbitrary, since JSON objects are unsorted) that matches.This is opposed to the behavior specified by
tsc
here:As far as I understand (zero rust experience, so please be forgiving), this can be rather easily fixed by sorting
paths
by index of*
in tsc.rs.I'm open to implementing it myself if that is indeed classified as bug that needs fixing.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.4.13&code=H4sIAAAAAAAAA8vMLcgvKlGoVshIzcnJV6hVSCvKz1VQd0gsKNAHChWkFhXrg6XUrbm4wAwNTWsAh2tUWDUAAAA%3D&config=H4sIAAAAAAAAA3WQvQ7CMAyE9z5FlbGq6M7EysDIhBhCamghbSzblaiqvDtJm%2FIzMEX3nX3yZcryXHWuHiyobT4FFbSMGJUyrutcf2dVLpyFWiMHV0dXaIDEe7fvBchhwFdtGQL20VN3Np9Y1NLwWwaw04hVEcgpkXnIPPQNuCoqJqOScS5%2FdhqwCMR%2Fd1c%2FJISZNWN%2Bfbr5ohmOZGPNzdoPNTHQ94U89qKfcSj%2BCRtqUZY8HztmPnsBwh9FpEEBAAA%3D
SWC Info output
No response
Expected behavior
Expected behavior is to match the longer
@app/helpers/*
pattern and emit:Actual behavior
Version
1.4.13
Additional context
No response
The text was updated successfully, but these errors were encountered: