-
Notifications
You must be signed in to change notification settings - Fork 734
Port tsc --init #2033
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
base: main
Are you sure you want to change the base?
Port tsc --init #2033
Conversation
| fieldName, _, _ = strings.Cut(jsonTag, ",") | ||
| } | ||
|
|
||
| if fieldName != "" && fieldName != "init" && fieldName != "help" && fieldName != "watch" { |
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 think there are other options like --all that also have to be dropped. Do we have some preexisting way to identify these rather than hardcoding them?
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.
Ah, no, this is actually straight ported. Fun. That's probably a bug!
| // commentedAlways': Always comment this out, even if it's on commandline | ||
| // commentedOptional': Comment out unless it's on commandline | ||
| const ( | ||
| commentedNever = 0 |
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.
You can probably declare a local type and use iota here.
| "moduleDetection": "force", | ||
| "skipLibCheck": true, | ||
|
|
||
| "declarationDir": "/home/src/workspaces/project/lib", |
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.
This path is printed incorrectly; it shouldn't include an absolute path.
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 think this might come down to the fact that our compiler options are fully resolved now, whereas the old code was not? In which case, you may need to resolve any path-like options relative to the working directory. But since you're just reflecting over options instead of going via options declarations, I am not sure how simple that is.
Perhaps this means we should change the method to not be like Strada and instead use the options declarations to find values... Which would probably also let us not special case the things I mentioned above.
This PR ports
tsc --initfromStrada.Fixes #1602