-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DO NOT MERGE] Reproduce internal error in tsc #7
base: dev
Are you sure you want to change the base?
Conversation
as needed by `--noImplicitThis` flag in checkjs command script
…SDoc type checing
…per.js - tsc (version 3.6.4) seems to throw an internal error at this point
I think that's failing because you trying to type a complex object with properties as just Object. Object is very generic, equivalent to type I took the liberty to look at your /**
* @typedef {Object} Helper
* @prop {() => string} getTSCCommand
* @prop {() => any[]} resolveTSFiles
* @prop {() => Command} getOptions
*/
// Apply the above type to the Helper object:
/** @type {Helper} */
module.exports = Helper; But I'm not sure is that's the best place to be designating Helper's type. Give it a try and let me know if it explodes. |
Ok, I downloaded this and took a good look at it. First main problem, TypeScript hates expando properties. You were create Helper as {} and then tacking methods on with dot notation. TypeScript cannot understand those. So I refactored you object which fixed that problem. Next I had a problem where you were importing the package.json. TypeScript needs a special flag for that so I added it to my tsconfig.json file. Oh, and I added a tsconfig.json file to organize all these TypeScript options. That means the npm script is just: "scripts": {
"checks": "tsc"
} Here's a link to my repository: https://github.com/rbiggs/glob-tsc-dev If you want. I can fork this, fix it and send you a pull request. |
This PR shares many commits in common with PR #6 for strict JSDoc type linting.
The following update in 032d29d causes tsc 3.6.4 to crash:
This seems to be an interesting case of microsoft/TypeScript#32231.
I think there is more work I have to do to export the correct helper object type.
/cc @rbiggs