Tagged: TypeScript validation lint
- This topic has 13 replies, 3 voices, and was last updated 6 years, 1 month ago by Brian Fernandes.
-
AuthorPosts
-
rob.nelsonParticipantI’ve deleted my settings, reinstalled CodeMix, and removed per used clean Eclipse settings.
There is absolutely nothing in the project that mentions TypeScript.
Is this a bug?
timwebbKeymasterAre you referring to extended validation? How do you mean the files are detected as TS?
If you don’t like the extended validation, you can turn it off via CodeMix > Workspace Settings > “javascript.implicitProjectConfig.checkJs”. We have this on by default to give more robust JS validation though you can absolutely turn it off.
Either way, please do share some details. Thank you!
rob.nelsonParticipant“and removed per used clean Eclipse settings” from above should read:
removed project settings; used clean Eclipse settings.
rob.nelsonParticipantIn the file proxyengine.js, CodeMix shows the following errors.
timwebbKeymasterDid you mean to attach a screenshot?
rob.nelsonParticipantErrors:
rob.nelsonParticipantThe file won’t upload, but the errors are:
Cannot invoke an expression whose type lacks a call signature.
Type ‘string’ is not assignable to ‘string[]’.
These are TypeScript errors.
rob.nelsonParticipantThe Eclipse property page Resource lists:
Type: File (JavaScript Siurce File)
rob.nelsonParticipantI am behind a firewall so I have to post this from my mobile.
In addition to that, it’s raining.
I apologize for the low quality of the responses. It’s one of those days.
rob.nelsonParticipantTo answer the first question, CodeMix seems to think this file is TS. I have created a whole new file and copied the contents outside of Eclipse. CodeMix seems to think the new file is TS, too.
…implicitProjectConfig.checkJs is false. I haven’t used that setting at all, but it is false on my fresh install.
I tried to upload a file twice, badly.
I hope this information is helpful for troubleshooting this issue.
timwebbKeymasterRob,
Can you confirm that implicitProjectConfig.checkJs is false in both User and Workspace settings? The exact purpose of this is to give validation “more like” TypeScript to JavaScript files. Based on the error you typed, which was indeed helpful, this does appear to be exactly the case of checkJs providing extended validation over what you normally get in JavaScript with type inference, etc.
In CodeMix 2, the checkJs default is now initialized one time to true to provide richer validation, and is defaulted at the Workspace level. If you turn it off, it won’t turn it on again.
Thanks for double checking!
rob.nelsonParticipantThat solved the problem.
I was wondering if this issue is a bug, because one of the errors indicated that it couldn’t find (what I believe is) a source map file ending in .d.ts. Inside Eclipse the file is identified as JavaScript and CodeMix appears to understand file extension.
Also, it would be nice to have this kind of inspection for JSX that CodeMix has for TypeScript.
Thank you for all the feedback and help for this issue. CodeMix is a great product with great support!
timwebbKeymasterGlad you are up and going!
If at some point you have a small sample project showing the problem and steps to break it, we’d love to make this more seamless for you and other users.
Happy to have you on CodeMix!
Cheers,
Tim
Brian FernandesModeratorRob,
One possibility is that you have a
tsconfig.json
file in the same project – do you? Any directory that’s a descendant of the directory containing this file might treat JS files as TS.If you do have a tsconfig.json file, you might try setting the
allowJs
(please note,allowJs
notallowJS
)compilerOptions
property tofalse
, and see if that makes a difference.The question about
.d.ts
might have been a failed request for a typings file (used to provide better IntelliSense).Thanks!
-
AuthorPosts