vuejs / pinia

🍍 Intuitive, type safe, light and flexible Store for Vue using the composition api with DevTools support
https://pinia.vuejs.org
MIT License
12.91k stars 1.02k forks source link

in ts getters using 'this' doesn't affect #2537

Closed squarexyz closed 8 months ago

squarexyz commented 8 months ago

Reproduction

https://play.pinia.vuejs.org/#eNqNVE1vGjEQ/SvWXoAG7KS0UYUgoq1ySA9t1fS4l/0YwMQeW7aXIKH97521YSFpFfW2nnnz5s2zZw/ZZ2v5roFsls195aQNzENoLFMFrhd5Fnye3eUotTUusANrPDwG44C1bOWMZgMuKtNgAMeDH+SYY2XQE0kELXr8cJTjXKQOxEeHANqqIgCdGJuXTQgG2bJSsnqivrGe49UVtX/AyoEGpP6HRMyRte1cpCIimIueLRtnSexEF5ZvvUEa7dD1yI8JmmjGYqSLWYmy6CJ5JuI3B68npTPPnmbaEnh8gi7JJ1HDLhij/KSwMpVtQrB+JkRVI+FrUHLnOEIQaLX4q2Z5yz/yG6FkKaiRkFjD/mUbqpjUoP+H/QRdXvObD/w2su6mR1LdsXakbY4t2RI8Xc1Krl+ZUhltpQL3wwZJV/fCnEIp8/wtxoJroJdYbaB6+kd86/dJ9U8HZN8OLsYKhVtDSOn7x++wp+8+qU3dKEK/kfwF3qim05hgXxqsSfYFLqp9iHcscf3b3+8DoD8N1QmNbkR8tPnrG6Of5U759MLF82snC/u1qGEl8dVmxNdEK9GDHKz6JHWP2wL7mExL0y/X4pJwODj2HIyTPB/ooc/YcMQWd2x4oGJKz9g1a0dxNtJNaN8PU5umVF1BLBzNGDa6BNdVxwiPBOwde3+0siirjv4SGDbS80REwE9nI4sqetc3k6dlJXnHEEvVsQstdIyRm8lS+i9k7R8SN4D2

Steps to reproduce the bug

image

"pinia": "^2.1.7", "node": "21.5.0" "typescript": "~5.3.0", "vite": "^5.0.10", "vitest": "^1.0.4", "vue-tsc": "^1.8.26"

// tsconfig "compilerOptions": { "composite": true, "noEmit": true, "baseUrl": ".", "strict": true, "paths": { "@/": ["./src/"] } }

Expected behavior

use this autocompletion and typings for the whole store

Actual behavior

this not affect

Additional information

No response