-
Notifications
You must be signed in to change notification settings - Fork 522
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
feat(typescript): add allow_js support to ts_project #2260
feat(typescript): add allow_js support to ts_project #2260
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
Fantastic PR, thank you! Could you try to satisfy the Google CLA bot please? I think it's my obligation to keep clean Intellectual Property in this repo. Maybe the email on the commit doesn't match the one that signed it. |
"$(locations :types)", | ||
"$(locations :tsconfig)", | ||
], | ||
) |
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.
Should we use generated_file_test here?
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 agree it would be better, but not enough to nitpick and make more work for casual contributors
@googlebot I fixed it |
As of TypeScript v2.9, `tsc` can read and extract types from `.json` files by using the `resolveJsonModule` option. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#new---resolvejsonmodule The new behavior allows people to pass `resolve_json_module` to `ts_project` in order to expect `.json` files from `tsc`. This change was modeled after the previous `allow_js` work in bazel-contrib#2260. Fixes bazel-contrib#2365
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The current behavior for
ts_project
is to ignore.js
files and not generate.d.ts
files from them.Issue Number: N/A
What is the new behavior?
As of TypeScript 3.7, tsc can now create
.d.ts
files from.js
files.The new behavior is allow the user to pass
allow_js
tots_project
in order to expect.d.ts
files fromtsc
.Does this PR introduce a breaking change?
Other information