Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

Exclude files from tslint #482

Closed
Closed

Description

@hermitdemschoenenleben

Tslint shows errors even for external typescript libraries inside the node_modules folder. I think it would be a good idea to exclude the node_modules folder from tslint or (even better) to create a configuration option for excluding file patterns

Activity

  1. danbucholtz commented on Jan 28, 2017

    @danbucholtz
    Contributor

    This should be resolved now. In our tsconfig.json we exclude node_modules.

    Thanks,
    Dan

  2. chrene commented on Apr 26, 2017

    @chrene

    I still see vendor code from node_modules being linted

    In my case it is the ng2-img-cropper module that gets linted.
    tslint: node_modules/ng2-img-cropper/src/model/point.ts

    my tsconfig.json is

    {
      "compilerOptions": {
        "allowSyntheticDefaultImports": true,
        "declaration": false,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "lib": [
          "dom",
          "es2015"
        ],
        "module": "es2015",
        "moduleResolution": "node",
        "sourceMap": true,
        "target": "es5"
      },
      "exclude": [
    	"node_modules"
      ],
      "include": [
        "src/**/*.ts"
      ],
     "compileOnSave": false,
      "atom": {
        "rewriteTsconfig": false
      }
    }
    
  3. Domvel commented on Aug 14, 2018

    @Domvel

    @danbucholtz How? e.g. exclude src/models does not work for the linter. He still scans this folder.
    I expected a property in tslint.json exclude and / or include. I use ionic app scripts.
    It's right that tsconfig.ts exclude should also work for the linter. But what's wrong in my case?
    I also tried src/models/**

    Background src/models are auto-generated files. I do not want to lint them.

    Update (a second later 😄 )
    Ok, nevermind: "**/src/models/**" works.

    Update
    This does not work for the build. Only for the linter.
    Error: File specification cannot contain multiple recursive directory wildcards ('**'): **/src/models/**
    Ok, I can try some other variations and read the specification of this syntax. 😄 Any suggestions?

    Only **/src/models/** works. Same in settings.json of VS Code.
    Btw. in include is src/**/*.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions