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
Convert shell-client.js to shell-client.ts #10619
Convert shell-client.js to shell-client.ts #10619
Conversation
tools/shell-client.ts
Outdated
import * as path from "path"; | ||
import * as net from "net"; | ||
import { isEmacs } from "./utils/utils"; | ||
//@ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignored, because:
Could not find a declaration file for module 'chalk'.
'/git/meteor/tools/node_modules/chalk/index.js' implicitly has an 'any' type.
Try `npm install @types/chalk` if it exists or add a new declaration (.d.ts) file containing `declare module 'chalk';`ts(7016)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chalk 2.2.0+ has type definitions file https://github.com/chalk/chalk/releases/tag/v2.2.0
should we update chalk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m going to keep the require
style for now, per #10614 (comment).
d3ed1a2
to
f1260a5
Compare
Here’s where we override the type for If you run cd path/to/meteor/tools
../meteor npx tsc instead of just checking the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @afrokick!
|
||
this.shellDir = shellDir; | ||
} | ||
constructor(public shellDir: string) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of my favorite TypeScript features: you can declare instance variables with appropriate visibility and types right in the parameter list of the constructor!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter properties)
Could you please provide a feedback in https://forums.meteor.com/t/request-typescript-code-style/49498 about Code Style?
Ok, just tried to convert shell-client to ts.
I have same questions mentioned in #10614 about level branch, VS Code' settings, typedefs.
And I have an issue when compile a file:
How to properly compile it?