quasar icon indicating copy to clipboard operation
quasar copied to clipboard

Move `src` and `app` aliases to the end of `path` section in `.quasar/tsconfig.json`

Open FragsterAt opened this issue 7 months ago • 6 comments

What happened?

They placed at the beginning of path section, so automatic imports (at least in vs code) starts with 'src/...

What did you expect to happen?

If they'll be moved to the end of path section, automatic imports finds first more compact variant of import, i.e. stores/store instead of src/stores/store, that makes code less 'noisy'.

Reproduction URL

https://stackblitz.com/edit/quasarframework-stackblitz-templates-dtyc5iwp?file=src%2Fpages%2FIndexPage.vue&title=Quasar%20Framework%20-%20app-vite%20v2

How to reproduce?

delete .quasar folder in project run npx quasar prepare look in .quasar/tsconfig.json

Image

this must be at the end of section for short auto imports

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)

Platforms/Browsers

No response

Quasar info output


Relevant log output


Additional context

No response

FragsterAt avatar Jul 22 '25 09:07 FragsterAt

Does stores/store import src/stores/store or app/stores/store?

stefanvanherwijnen avatar Jul 24 '25 16:07 stefanvanherwijnen

Does stores/store import src/stores/store or app/stores/store?

@stefanvanherwijnen they are all aliases for the same file: project_folder/src/stores/store.ts or '.js'

Autoimport in VS Code check aliases from first to last and use src/stores/store now and stores/store after fix.

FragsterAt avatar Jul 24 '25 18:07 FragsterAt

Does stores/store import src/stores/store or app/stores/store?

@stefanvanherwijnen they are all aliases for the same file: project_folder/src/stores/store.ts or '.js'

Autoimport in VS Code check aliases from first to last and use src/stores/store now and stores/store after fix.

I believe app points to the project folder. My point is that you can't just remove the alias, or you would need to alias stores. Keep in mind that it's not just TS aliases, but also Vite aliases.

stefanvanherwijnen avatar Jul 24 '25 18:07 stefanvanherwijnen

I suggest not to remove aliases, but to move them to the end of paths. All imports will continue working.

alias for project folder is app, so without app\... no file can be imported from root of project. This is current berhaviour, and it is the same after fix.

Fix corrects only autoimport behavior to use more compact imports in VS code. All aliases are present in current tsconfig.ts When you write const myStore = useStore and press ctrl+space, autoimport in VS Code check aliases from first to last and use src/stores/store now and stores/store after fix. If you manually change import to stores/store - everything continued working.

off: sorry for bad english

FragsterAt avatar Jul 24 '25 18:07 FragsterAt

You are probably right for tsconfig, but I'm pretty sure this would break the Vite aliases.

stefanvanherwijnen avatar Jul 24 '25 19:07 stefanvanherwijnen

I'm now working with this fix applied. yarn serve and yarn build are working perfectly.

FragsterAt avatar Jul 25 '25 06:07 FragsterAt