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

Exclude files from tslint #482

Closed
hermitdemschoenenleben opened this issue Nov 28, 2016 · 3 comments
Closed

Exclude files from tslint #482

hermitdemschoenenleben opened this issue Nov 28, 2016 · 3 comments

Comments

@hermitdemschoenenleben
Copy link

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

@danbucholtz
Copy link
Contributor

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

Thanks,
Dan

@chrene
Copy link

chrene commented Apr 26, 2017

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
  }
}

@Domvel
Copy link

Domvel commented Aug 14, 2018

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants