Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Inconsistent usage of --exclude option #1560

Closed
k0pernikus opened this issue Sep 19, 2016 · 4 comments
Closed

Inconsistent usage of --exclude option #1560

k0pernikus opened this issue Sep 19, 2016 · 4 comments

Comments

@k0pernikus
Copy link

Bug Report

  • TSLint version: 3.15.1
  • TypeScript version: 1.8.10
  • Running TSLint via: (please choose one) CLI

TypeScript code being linted

with tslint.json configuration:

{
    "extends": "tslint-config-ms-recommended"
}

Usage of exclude:

Run

  • tslint src/**/*.ts --exclude src/**/*.d.ts
  • .tslint src/**/*.ts --exclude "src/**/*.d.ts"
  • .tslint src/**/*.ts --exclude=src/**/*.d.ts

Expected behavior

All three should either ouput only the *.ts and ignore *.d.ts files or throw an error of faulty usage.

Actual behavior

The usage of --exclude src/**/*.d.ts prints *.d.ts lints:

tslint src/**/*.ts --exclude src/**/*.d.ts | grep -m 1 highland.d.ts
src/interfaces/highland.d.ts[81, 31]:    Type declaration of 'any' is forbidden

Only the two other work as expected.

@FrozenPandaz
Copy link

FrozenPandaz commented Dec 2, 2016

I'm not able to exclude any files on version 4.0.2 with any of those configurations... Did something break?

Edit: Nevermind, i needed to do **/src for some reason its grepping absolute paths?

@adidahiya
Copy link
Contributor

the globs in tslint src/**/*.ts --exclude src/**/*.d.ts are expanded by your shell, not the TSLint CLI. not much we can do there. see related discussions #692, #827, etc.

@ghost
Copy link

ghost commented Sep 7, 2017

But what about in your tslint.json? Nothing ever seems to be excluded when listed there.

@adidahiya
Copy link
Contributor

@KSuttle-cng exclude is not yet supported in tslint.json, that will be in v5.8 with #2409.

Note that you can send strings to --exclude and they will be expanded by node glob: --exclude 'src/**/*.d.ts'.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants