-
Notifications
You must be signed in to change notification settings - Fork 519
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
Cannot use plain JS sources with TypeScript targets #1657
Comments
While I agree that ts_library should take all inputs that normal |
This is tricky since JS and MJS files are generated at the same output path as the source file. It would seem that even manual use of TSC might encounter conflicts noticed by bazel. I have run into this issue myself when I want to perform multiple transformation steps on an input file; you have to ensure distinct output paths. @Toxicable are you aware of any plans to somehow make output files distinct from source files, perhaps with a different file extension? |
@joeljeske good point, perhaps a mostly my goal here is checking existing js, but compiling ts with js would be nice. checking JS might not need to create files at all |
I think the problem of input artifacts having the same path as output artifacts is orthogonal to the question here which is simply about the restriction we placed on which files are allowed in the srcs of ts_library. I agree it should be relaxed, though we'll need to take care with that change since it wouldn't be desirable in google-internal (they use closure compiler to check .js files and wouldn't want them allowed as srcs of ts_library) FWIW I should adjust my |
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?" |
Any updates on this issue? I'm suffering from the same issue... |
I think this works with |
Hey, looks like #2120 is resolved, is there a chance to support JS files with |
This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
Sorry I don't think anyone has time or interest to dive into ts_library to add features like this. If you just want to typecheck .js files, ts_project works great. |
🐞 bug report
Affected Rule
ts_library
Is this a regression?
I don't think so, no
Description
There should be an ability to use JS sources with the
ts_library
rule, so that one might use the TypeScript compiler to check JS files (via theallowJs
/checkJs
compiler flags totsc
). Currently, though, trying to use*.js
sources withts_library
yields the error:This is because the ts_library rule implementation forbids sources with extensions other than
ts, tsx
forts_library
.🔬 Minimal Reproduction
SomeFile.js
:// (anything)
tsconfig.json
:BUILD.bazel
:Then:
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and
@bazel/*
npm packages.)rules_nodejs
version:1.3.0
The text was updated successfully, but these errors were encountered: