-
Notifications
You must be signed in to change notification settings - Fork 47
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
defaulting to tsconfig: true #198
Comments
I am happy to change this, but how would you expect it to work in the situation where you have file-level typescriptOptions as well as global typescriptOptions defined? Currently the plugin will resolve both tsconfig files if specified and merge all the configuration (see https://github.com/frankwallis/plugin-typescript/blob/master/src/resolve-options.ts#L17) although I'm not sure that is the correct behaviour. |
Thanks for considering this. That said I would say that any top level tsconfig.json file should be merged with the global typescriptOptions and since global options are currently merged into file specific typescriptOptions that behavior probably should work with this change, thusly merging all of the options. I may have misunderstood the finer points of your statement but in general I think of wanting file specific settings more to disable behavior than to enable it. |
I've been giving this some thought and I think the current merging behavior is the right approach, at least for the time being. So for give the following directory layout src\ the settings from the ambient tsconfig.json file would be merged into any top level For nested configs src\ the settings from the ambient src\primary\tsconfig.json file would be merged into any "packages:" {
"src\primary": {
"meta": {
"main.ts": {
"typescriptOptions": { ... }
}
}
}
} in Does this seems correct? |
@frankwallis would you be open to a pull request for this? I'm a little on the fence about whether this belongs in plugin-typescript or JSPM. On the one hand, introducing the behavior here will have the broadest impact on users, but on the other, JSPM users are more comfortable with configuring transpiler options, but there is a discoverability issue. With the removal of type checking support, the most important use case is changing the module and target. Another way to address this would be to warn users when a The primary interest I have here is to make it easy for the IDE experience and the runtime behavior to correspond. If you feel this is more of a JSPM feature, then I would happily raise the issue there, with the suggestion that a pre-populated options object be added to the default Another thing that occurs to me is that there should perhaps be a single line of log output that indicates when a Thank you. |
Yes, I am open to a pull request but I would like to know what the impact will be on existing users. I think that all tsconfig handling would be better handled in this plugin than in jspm. |
I think the simplest thing to do would be to apply a top-level tsconfig only but _not _ to merge it with any Part of the reason I thought to put this in JSPM was that the generated configuration would make it explicit that the tsconfig file was in use. I agree though that it belongs here. I think simply logging a message stating that it's been picked up, possibly along with some other information such as the TypeScript version, could be a good way to go. Both of Webpack's TypeScript loaders do this (print using tsconfig and TypeScript version) for what it's worth. |
With the breaking change of removing TypeChecking, I thought it would be a good time to propose something that I have wanted for a long time.
When setting up a new project, I will always have a
tsconfig.json
file for IDE support. But it is ever so slightly annoying to have to add the"typescriptOptions.tsconfig": true
to jspm.config.js/systemjs.config.js every time I set up this plugin.Would it be possible to assume this by default going forward?
Given that users will now need to rely on type checking in their IDE, it is more essential than ever that transpilation settings that the syntactic transformation options, some of which block the user of certain features, are in sync between one's IDE and plugin-typescript.
Another thing is that sometimes people use both this and plugin-babel on the same chunks of code to verify consistency of certain transpiler behavior.
I think this would strongly benefit new users as this is a gotcha that I frequently have to remind people about and explain how to configure.
Thank you.
The text was updated successfully, but these errors were encountered: