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
JSDoc type fixes in src/main/core-options.js
#6702
JSDoc type fixes in src/main/core-options.js
#6702
Conversation
with unused `oppositeDescription` parameter removed and reordering of some other members to resolve checkJs issues in `src/main/core-options.js`, as verified by the following command: npx tsc --allowJs --checkJs --noEmit --target es5 src/main/core-options.js
This looks good to me! Adding a tsconfig.json won’t hurt, will it? Sounds like a good idea to me, since it would make things easier to check in the future. |
No but we may want to coordinate it since @Shinigami92 already proposed a tsconfig.json file in #6313. I made this change to be self-contained on purpose, so we should be able to merge it as-is if accepted. I do have some other changes for JSDoc type fixes in my workarea which may need some better coordination. Maybe I should raise an issue to coordinate these. Thanks! |
I don't believe you would need a |
@rbiggs Is there any practical difference between upd: My testing shows that |
This is going off-topic, but I think we need tsconfig.json and not jsconfig.json to configure how An alternative solution would be to simply use the options and filespec on the command line, and this is what I sometimes do for a quick check. But I think this is not what we want in the end for a couple of reasons. I had some trouble with path wildcards on Windows, and it does not seem to work with globs at all. Please correct me if I am mistaken here. I found and tried a It is also desired to include all .js files by default, using tsconfig.json to specify what to exclude instead. Thanks again to @rbiggs for helping me get started with this work. |
@thorn0 and @brodybits, I never use a |
@rbiggs |
OK, my bad. Created a proper |
Yep! |
No, |
But |
The |
So we have the answer 🎉 |
That's what they write there. But in fact, this so called JavaScript language service is nothing else than the good old TS language service. As we know, it supports JS, so technically it is a JS language service too, no cheating! They just don't want to write that on that page to not scare anyone off. :) |
True, but most |
Flow has its own incompatible syntax and thus a language service, but you got my point. |
I just noticed something. Removed the |
Didn't you forget to copy some configuration from jsconfig to tsconfig? |
Nope, they have the same file information. Just tsconfig has all the extra options for tsc. Otherwise the rest is the same. Go figure. I used to be able to just type a function and hit enter to get an automatic import. Without jsconfig that's not working now. Putting the jsconfig back in fixes the automatic import of JavaScript files. |
Ah, just so you guys know, my |
Actually, it was because my |
with unused
oppositeDescription
parameter removedand reordering of some other members
to resolve checkJs issues in
src/main/core-options.js
,as verified by the following command:
I can also enable Check JS in VSCode and see that the type errors go away in
src/main/core-options.js
.In the future, it should be possible to typecheck the whole project by either:
npx tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es5 src/index.js
npx tsc
or use a script that callstsc
to check all sourcesfor reference:
see also:
/cc @Shinigami92 @rbiggs
I’ve added tests to confirm my change works.(If changing the API or CLI) I’ve documented the changes I’ve made (in thedocs/
directory)(If the change is user-facing) I’ve added my changes to theCHANGELOG.unreleased.md
file following the template.✨Try the playground for this PR✨