oklas / react-app-alias

:label: Alias and multiple src directory for craco or rewired create-react-app
MIT License
174 stars 18 forks source link

fix: config path for PluginTsChecker for non-ts proj #41 #42

Closed oklas closed 2 years ago

oklas commented 2 years ago

Closes #41

urmzd commented 2 years ago

I think a better solution to prevent name-specific issues would be to match [jt]sconfig\..*\.json. Is this something you would consider? If so, I can open a PR

oklas commented 2 years ago

Hi Urmzd, this pr mostly workaround than final. Actually it must not to guess the name of config file. If you have some case that may not be solved, then explain it.

urmzd commented 2 years ago

Hi @oklas, use any path that deviates from the pattern ^[jt]sconfig(\.paths)?.json, and the plugin cannot resolve the aliases correctly. This is problematic for two reasons

  1. The documentation doesn't make it explicitly clear, that the only supported file names are those specified by the previous pattern. As a result, individuals may experience compilation failures without any possible reason as to why.
  2. There's no need to restrict the file names. There's no benefit in doing so, and causes more hassle then needed.

For these reasons, I think we should allow users to use different names. We don't have "guess" the name, but rather grab the file path from "extends". What do you think?3