facebook

tslint does not respect "exclude" option

  1. CodeMix & Angular IDE
  2.  > 
  3. Webclipse 1.x Help
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #589071 Reply

    I need to exclude a directory with generated code from tslint
    Adding

      "linterOptions" : {
        "exclude" : [
    	  "src/app/rest/**"
        ]
      }   
    

    to tslint.json makes the warnings go away with command line tslint, but they are still shown in Angular IDE. How can I exclude files?

    #589146 Reply

    support-swapna
    Moderator

    Alex,

    Can you please clarify in which file you added the exclude code? Is it in the tsconfig.json or in the tsconfig.app.json?

    By default, the angular project uses tsconfig.app.json which extends the tsconfig.json and is located in the src folder. You can recheck which tsconfig.json is used in the project from the project Properties > TypeScript page.

    You can edit the exclude property in the tsconfig.app.json file and add filters for the folders you want to exclude.

    Hope this helps. Please let us know how it works for you.

    –Swapna
    Genuitec Support

    #589306 Reply

    I added it to tslint.json, which worked with tslint executed in the terminal.
    When I added the exclude to src/tslint.json, it also worked with tlsint on the command line with a relative path (app/rest/**)

    Adding the linterOptions to tsconfig.json or tsconfig.app.json did not work with the command line or with the tslint problems in eclipse. None of the configurations removed the problems shown in eclipse.

    However, other changes in tslint.json (e.g. setting “no-trailing-whitespace” to false) reduced the number of problems in eclipse, so tslint.json is respected, but the exclude does not work

    #589428 Reply

    support-swapna
    Moderator

    Alex,

    Sorry that the suggestion did not help.

    It looks like the linterObject setting is not being respected by our tooling. I have filed a bug for the dev team to look into it. I am afraid I cannot suggest any workaround for now. We will keep you posted when the fix is out.

    Apologies for inconvenience caused. Thank you once again for raising it.

    –Swapna
    Genuitec Support

    #589431 Reply

    Thanks for the info. My workaround is to disable tslint for now.
    Don’t forget to name it “linterOptions” in the bug, not linterObject.

    Is there a way I can subscribe to updates of the bug?

    #589865 Reply

    Brian Fernandes
    Moderator

    Alex,

    We do not have a public tracker for Angular IDE issues yet, but we will let you know whenever there is an update (linked this thread with the internal bug).

    If you do want TSLint back on right now, I take this opportunity to point out that you could try installing CodeMix into Angular IDE. CodeMix tech will eventually be integrated into Angular IDE 2018, but if you install it manually right now, it will work in a complimentary fashion with Angular IDE. We verified for instance that the TSLint support in CodeMix does respect the exclusions in tslint.json correctly. Installing CodeMix should also bring with it better support for Angular 6, as well as more recent versions of TypeScript, if that matters.

    I will mention that the full Angular IDE 2018 will be more integrated than what you’ll get by adding CodeMix to Angular IDE yourself right now, but it might be good enough for your current needs.

    Hope this helps.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: tslint does not respect "exclude" option

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