facebook

Why does CodeMix 2.0 think my .js files are TypeScript?

  1. CodeMix & Angular IDE
  2.  > 
  3. Getting Help
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #599390 Reply

    rob.nelson
    Participant

    I’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?

    #599391 Reply

    timwebb
    Keymaster

    Are 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!

    #599392 Reply

    rob.nelson
    Participant

    “and removed per used clean Eclipse settings” from above should read:

    removed project settings; used clean Eclipse settings.

    #599393 Reply

    rob.nelson
    Participant

    In the file proxyengine.js, CodeMix shows the following errors.

    #599394 Reply

    timwebb
    Keymaster

    Did you mean to attach a screenshot?

    #599395 Reply

    rob.nelson
    Participant

    Errors:

    #599396 Reply

    rob.nelson
    Participant

    The 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.

    #599397 Reply

    rob.nelson
    Participant

    The Eclipse property page Resource lists:
    Type: File (JavaScript Siurce File)

    #599398 Reply

    rob.nelson
    Participant

    I 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.

    #599399 Reply

    rob.nelson
    Participant

    To 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.

    #599400 Reply

    timwebb
    Keymaster

    Rob,

    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!

    #599455 Reply

    rob.nelson
    Participant

    That 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!

    #599457 Reply

    timwebb
    Keymaster

    Glad 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

    #599459 Reply

    Brian Fernandes
    Moderator

    Rob,

    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 not allowJS) compilerOptions property to false, 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!

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: Why does CodeMix 2.0 think my .js files are TypeScript?

You must be logged in to post in the forum log in