Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-exporting a Vue component will strip its typing information when enabling "noPropertyAccessFromIndexSignature" TS rule #11732

Open
cellador opened this issue Aug 28, 2024 · 0 comments

Comments

@cellador
Copy link

cellador commented Aug 28, 2024

Vue version

3.4

Link to minimal reproduction

https://play.vuejs.org/#eNqVUsFKw0AQ/ZVlL1WQBNFTSQtVKtSDFutxQWIyTbcmu8vupEZC/t3ZjaktasFbdt57kzczr+UzY6JdDXzME5dZaZA5wNqwMlXFRHB0gk+FkpXRFlnLbnVlWMfWVldsFMVS5dCMhEriXkxUeiBUpkwR6MVYEiTjPMWU+rUaN2BfKleM2eg1taOO+iex5xA7iQ+k/IL+nmm1lkW0dVqRxdY3FDwjtizBPhqUWpHDMQuIx9Ky1O/3oYa2houhnm0ge/ulvnWNrwm+tODA7kDwPYapLQB7eL56gIa+92Cl87ok9gnwCZwua++xp93UKifbB7zgdhGWK1Xx7OYNgnLDUEdGlV5abcDixyzLwLk7OsHCr38lC5VibYMXL/GKLugEp9P63f61re8Jr6LroBOqo8V7zX9ikcNaKvAG3T4dJKdkCEUndMhMwCaHzCTY8MEgRyxEwqGlPQQX07Pz07naXE7btu8b+SYRdWBdl8QE/IxSSGqEjib6ch1yOQR5GDg4huYo7bz7BJN9EXU=

Steps to reproduce

In the provided link, toggle the noPropertyAccessFromIndexSignature rule in the tsconfig.json.

What is expected?

The rule should not have an effect on the typing of Comp in the template block.

What is actually happening?

When turned on, the Component exported from index.ts will be typed as Any (only inside the template block, though!). This will silence the typing error present in the example.

System Info

No response

Any additional comments?

This error hid a number of typing errors on our site. Trying to reproduce it showed that in fact it's this rule which affects the behavior.

CheckmkCI pushed a commit to Checkmk/checkmk that referenced this issue Sep 3, 2024
We encountered a bug with vue/ts in our configuration:
If we re-export a vue component, it will be typed to any
if used inside Vue's <template>.
Disabling this typescript rule restores the expected typing.

Github issue link:
vuejs/core#11732

This also uncovered that radix didn't adhere to our typing rules,
we silenced those errors.

CMK-18584

Change-Id: Ieeef6f3d7cadcbfbc0366ee67972e8b7dd9e16c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants