-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Generator function typed with non optional parameter, throws error TS2345 #31
Comments
Seeing the same! My dependencies (excerpt):
|
Thanks for reporting and confirming. I added You're doing everything correctly. I'll try to revise the types and loosen them, if not possible. |
Can you share your |
Sure:
|
in {
"compilerOptions": {
"target": "es2017",
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noImplicitThis": true,
"alwaysStrict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noEmitOnError": false,
"noEmit": true,
"inlineSourceMap": true,
"inlineSources": true,
"module": "es6",
"lib": ["es2017.object", "es2016", "dom", "dom.iterable", "scripthost"],
"experimentalDecorators": true,
"downlevelIteration": true
},
"exclude": ["tmp", "dist", "vendor", ".git", ".gradle", ".idea", "logs"]
} in {
"extends": "../tsconfig-base",
"compilerOptions": {
"baseUrl": ".",
"alwaysStrict": false,
"strictPropertyInitialization": false,
"lib": ["es2017.object", "es2016", "dom", "dom.iterable", "scripthost"],
"listEmittedFiles": false,
"paths": {
"app/*": ["app/*", "node_modules/<addon-app>"],
"app/tests/*": ["tests/*"],
"app/mirage/*": ["mirage/*"],
"addon-app": ["node_modules/<addon-app>/addon"],
"addon-app/*": ["node_modules/<addon-app>/addon/*"]
}
},
"include": [
"app/**/*",
"tests/**/*",
"mirage/**/*",
"node_modules/<addon-app>/app",
"node_modules/<addon-app>/addon"
]
} |
Thanks a lot for reporting and providing your configs! I published a fix as Let me know, if it works for you. 😊 Edit: The latest version should also support encapsulated tasks now. |
FYI you're gonna run into more type errors, when actually trying to perform the task. However, after weeks of trial and error (and despair 😅), I have found a potential solution: #30 It's definitely not perfect, but I think it provides the least amount of friction for the most use cases. I've posted it to #e-typescript as well, to get some export opinions on it. |
Awesome! Thanks @buschtoens , I will try this over the weekend with my upgrade to ember3.6 |
Can confirm, TS error is gone! Thanks Jan for the super quick fix! 👍 |
I'm seeing the error below when trying to annotate a generator function that takes a required parameter. If I make the parameter optional, then all is well. However, this would make my typings inaccurate!
If I define a class with the ffg attributes, I receive the commented out error from tsc.
It seems like a non-compliant type definitions, but my local investigation does not seem to back that up. Is this a known issue? How can I resolve this
The text was updated successfully, but these errors were encountered: