facebook

How to add a rule that prohibits indefinite variables

  1. CodeMix & Angular IDE
  2.  > 
  3. Webclipse 1.x Help
Viewing 15 posts - 16 through 30 (of 63 total)
  • Author
    Posts
  • #518502 Reply

    support-piotr
    Participant

    Gorand,

    If you have moved files around, you need to update “require” paths as well:

    require(“../index”) => require(“tslint”)
    require(“../language/utils”) => require(“tslint/language/utils”)

    since you cannot refer to any module within tslint package relatively if the file is outside of the package. That’s the first step.

    Second problem is in the way node.js resolves module locations. Any required modules from your custom rule script would be looked up based on the script location. That means if none of parent folders of folder containing your custom rule have node_modules with required module (be it tslint, or path_sync, or whatever else), the code will fail to load even if tslint was initially loaded fine. I will soon come up with a solution for this and give you steps to patch Webclipse without need for a new release. For now, a workaround would be to execute following commands in the folder, which contains your custom rule (Terminal+ view):

    
    mkdir node_modules
    npm install tslint@4.3.1
    

    You will also need to fix require calls to refer to tslint module. I hope this will get you going until I provide you with complete solution.

    Best regards,
    Piotr Tomiak

    #518651 Reply

    gorand
    Participant

    Hellow!

    I copy path: c:\eclipse\plugins\com.genuitec.eclipse.typescript_2.2.2.201703311443\bin\node_modules
    to my path: \TSLint\node_modules

    
    TSLint
     .\node_modules
     .\rules\andrTypedefRule.js
    

    and modify require in file andrTypedefRule.js:

    
    require(“../index”) => require(“../node_modules/tslint/lib/index”)
    require(“../language/utils”) => require(“../node_modules/tslint/lib/language/utils”)
    

    It worked!
    But I would like to do without copying all the files to my folder, but simply refer to the standard library with which WebClipse is currently running. Since every time you update WebClipse, it changes its location folder /node_modules/
    For example, like this:
    require(“%path_tslint%/index”)
    require(“%path_tslint%/language/utils”)

    #518654 Reply

    support-piotr
    Participant

    Gorand,

    I will include fix for your issue in the next release – CI 5. I will tweak node.js to prepend webclipse installation (or the projects dir) to the include path, when dealing with custom rules.

    Anyway, you should change your requires to not use relative paths, but absolute (I’ve missed the “lib” dir in my reply before):

    
    require(“../index”) => require(“tslint/lib/index”)
    require(“../language/utils”) => require(“tslint/lib/language/utils”)
    

    That way it won’t matter where in the folder hierarchy “node_modules” are located and will also be able to work once my fix is out.

    • This reply was modified 7 years, 7 months ago by support-piotr.
    #518849 Reply

    gorand
    Participant

    Hellow!
    How do I know if the update is installed?
    Today, WebClipse has been updated (com.genuitec.eclipse.typescript_2.2.2.201704061509), but still the relative path does not work.
    Maybe this update does not yet contain your changes?
    Here’s what I did:
    1) I deleted the node_modules folder from my folder containing my rules
    2) indicated the relative path in require
    3) restart eclipse – error path not found

    Attachments:
    You must be logged in to view attached files.
    #518852 Reply

    support-piotr
    Participant

    Gorand,

    yes, this was CI4a release with several hot fixes. I couldn’t include fix for your problem as it requires extensive testing in TSLint area to ensure we don’t get regressions. The fix will be present in CI 5, which is due in 3-4 weeks. However, I will most likely be able to provide you with patched plugin once I have the fix in place, so that you don’t have to wait so long for it. It should be done early next week.

    Best regards,
    Piotr Tomiak

    #522090 Reply

    support-tony
    Keymaster

    Gorand,

    This has now been fixed in our latest release, CI 5. Please go to Help->Webclipse->Check for Updates and follow the wizard to update to CI 5. Please let us know if you see any problems with the new release.

    #522526 Reply

    gorand
    Participant

    Hellow!
    I modify my rule

    
    require(“../index”) => require(“tslint/lib/index”)
    require(“../language/utils”) => require(“tslint/lib/language/utils”)
    

    There are a lot of mistakes in the new version CI5. Watch the my video: https://www.youtube.com/watch?v=9ng16R9iKdU

    1) now TSLint problems are not shown in the code editor window (sometimes they appear, but an internal WebClipse error occurs and they disappear – see the video)
    2) In the process of work there are too many internal errors WebClipse
    3) Why are TSLint problems now displayed as errors and not as warnings? (as it was before)
    The main question: now it is impossible to work properly with TypeScript and so tell me how to return to using CI4 version?

    #522742 Reply

    gorand
    Participant

    Hellow?
    You see my video? https://www.youtube.com/watch?v=9ng16R9iKdU
    How work into CI5 version ?

    #522743 Reply

    support-swapna
    Moderator

    Gorand,

    Sorry that you are seeing issues with CI 5. Thank you for sharing the video.
    We are investigating it further and we will get back to you soon.

    Apologies for inconvenience caused.

    –Swapna
    MyEclipse Support

    #522749 Reply

    support-swapna
    Moderator

    Gorand,

    Can you please share with us the .log file located at workspace dir/.metadata/.log for further investigation?

    –Swapna
    MyEclipse Support

    #522988 Reply

    gorand
    Participant

    Hellow!

    see log file

    Attachments:
    You must be logged in to view attached files.
    #523024 Reply

    support-swapna
    Moderator

    Gorand,

    Thank you for the log file. I have filed it for investigation with the dev team.
    We will get back to you soon. Thank you for your patience.

    –Swapna
    MyEclipse Support

    #523124 Reply

    gorand
    Participant

    Hellow!
    Is the error corrected in the new version of CI5? Now it is absolutely impossible to work.
    How do I get back to CI4 and turn off auto-update?
    The situation is unacceptable when the development stops for the update!
    See today log.zip

    Attachments:
    You must be logged in to view attached files.
    #523132 Reply

    Wojciech Galanciak
    Participant

    Hi Gorad,

    Thank you for reporting this issue. We are working on it and will try to provide a fix as soon as possible. As it is a blocker for you, we will soon provide you instructions about reverting to CI 4.

    Kind regards,
    Wojciech Galanciak

    #523137 Reply

    timwebb
    Keymaster

    Gorad,

    We’ve temporarily disabled evergreen server-side while we investigate this issue. From the log, it looks like you are using Webclipse as a plugin on Eclipse for Java Developers. Here is the update site to the CI 4a plug-in:

    http://downloads.genuitec.com/downloads/products/webclipse/updates/wc2017ci4a

    If you need the Angular IDE standalone distribution, please let us know. We will also look into a setting to disable Evergreen in our CI 6 update.

    Thanks and again, thanks for your patience!

    Tim

Viewing 15 posts - 16 through 30 (of 63 total)
Reply To: How to add a rule that prohibits indefinite variables

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