I’m still trying to improve my TypeScript setup for Meteor using zodern:types
, but it’s still a mystery for me when Meteor actually finds the types for a package and when not.
Until recently, it was able to resolve most of the packages, but now it does not find the definitions for meteor/react-meteor-data
anymore. I have no clue what caused this. I tried to add @types/meteor
manually, but this made things even worse, so I removed it.
Also just recently, Meteor stopped recognizing the transform
key in a find() / findAsync, so I have to cast the results to the actual model object now.
The issue might as well be related to a major update of WebStorm.
I attached my current config. If anyone has a clue why this does not work (anymore), I’d be super thankful. Adding types manually for things like useTracker() isn’t really fun.
{
"compilerOptions": {
/* Basic Options */
"target": "es2018",
"module": "esNext",
"lib": ["esnext", "dom"],
"allowJs": true,
"checkJs": false,
"jsx": "preserve",
"incremental": true,
"noEmit": true,
/* Strict Type-Checking Options */
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
/* Additional Checks */
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": false,
/* Module Resolution Options */
"baseUrl": ".",
"paths": {
/* Support absolute /imports/* with a leading '/' */
"/*": ["*"],
"meteor/universe-i18n": ["node_modules/@types/meteor-universe-i18n/index.d.ts"],
/* Pull in type declarations for Meteor packages from either zodern:types or @types/meteor packages */
"meteor/*": ["node_modules/@types/meteor/*", ".meteor/local/types/packages.d.ts"]
},
"moduleResolution": "node",
"resolveJsonModule": true,
"types": ["node", "mocha"],
"esModuleInterop": true,
"preserveSymlinks": true
},
"exclude": ["./.meteor/**", "./packages/**"],
"include": ["./.meteor/local/types", "./**/*"]
}