| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I could alternatively put tsconfig.json emitter logic in a new file called configEmitter.ts? It is now in the emitter.ts which hosts the code for the main compiler emitter logic, which might not be so appropriate. |
Sorry, something went wrong.
There was a problem hiding this comment.
I think this should be in tsc.ts, i would even inline it there.
Sorry, something went wrong.
|
Mohamed Hegazy (@mhegazy) could you please reconsider supporting comments. In addition to giving people verbose description, people might want to make annotations themselves in the config file. I can rework my PR if it it doesn't fit TS. |
Sorry, something went wrong.
|
I am fine doing comments. i just want them in a different change, it will make it easier to focus on one issue at a time, i.e. what are the defaults or the right things to emit, instead of talking about comments and parsing. In general i think writing the output should be simpler. for JSON comments, i would be incline to use the scanner to write a small JSON parser, instead of removing comments. |
Sorry, something went wrong.
But then you would need to create a JSON parser? Right now, I think it is easier to remove the comments and pass them to JSON.parse. |
Sorry, something went wrong.
|
I just updated the PR.
Can we skip splitting the comments in another PR? It is really a small addition(15-20 LOC) to this PR and splitting it out means quite much work for me. I mean saving it another branch and then to remember the branch and merge later and sync changes. |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
i do not think we need a full JSON serializer. That was my inital comment. for me this function, without the support for comments, can be written as:
JSON.stringify(opt, (k, v) => {
switch (k) {
case "target": return scriptTargetToString(k);
case "module": return moduleKindToString(k);
case "init":
case "watch":
case "version":
case "help":
return undefined;
default: return v;
}
}, " ");
Sorry, something went wrong.
|
sorry for the delay. let me clarify my comments earlier..
|
Sorry, something went wrong.
|
Mohamed Hegazy (@mhegazy) I just update the PR, please take a look when you have time. |
Sorry, something went wrong.
|
Sorry for the delay. I have manually merged it as there were merge conflicts, i have also marked the new declarations with the /* @internal */ to avoid them showing in the .d.ts, moved the init code to a helper, and streamlined the serialization. take a look in case i messed something up. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #3079.
Defaults to compiler options:
{ "module": "commonjs", "target": "es3", "noImplicitAny": true, "rootDir": ".", "outDir": "built", "sourceMap": false, }The compiler options are overridable and you are able to define more options via the CLI(with the exception of the CLI options help, watch, version, init).
Defaults to no files property but if one invokes with files:
It will add a files property with the specified files.
Adds an exclude of node_modules folder only.
It outputs comments and trailing commas in tsconfig.json. So this PR also adds parsing/stripping of comments and trailing commas in tsconfig.json file.