beholdr / maska

Simple zero-dependency input mask for Vue, Svelte, Alpine.js and vanilla JS.
https://beholdr.github.io/maska/
MIT License
1.79k stars 71 forks source link

fix(package.json): add typesVersions section into package.json #221

Closed fearoff closed 6 months ago

fearoff commented 6 months ago

Current installation method for vue3 app gives:

image

Next section at package.json solves problem for my case

  "typesVersions": {
    "*": {
      "vue": ["dist/vue.d.ts"]
    }
  },
beholdr commented 6 months ago

It's strange, typesVersions field is for differentiating types by TS version. Can you show your tsconfig.json? I'll try to reproduce.

fearoff commented 6 months ago

sure

tsconfig.json ```json { "compilerOptions": { "baseUrl": ".", "target": "ESNext", "useDefineForClassFields": true, "module": "ESNext", "moduleResolution": "Node", "strict": true, "jsx": "preserve", "resolveJsonModule": true, "isolatedModules": true, "esModuleInterop": true, "lib": ["ESNext", "DOM"], "skipLibCheck": true, "noEmit": true, "paths": { "@/*": ["src/*"], "quasar": ["node_modules/quasar"], "floating-vue": ["node_modules/floating-vue"], }, "types": ["vite/client", "node"], "allowJs": true }, "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], "references": [{ "path": "./tsconfig.node.json" }], "exclude": ["node_modules"] } ```
beholdr commented 6 months ago

I have checked, it seems moduleResolution: "Node" is deprecated option that fallbacks to Node 10. But looks like typesVersions enables new TS features so everything works again. JS ecosystem is a mess 🫠

Thank you for solution.