MarcoLe
MarcoLe

Reputation: 2509

TSLINT- Overriding rules for specif file or directory

Is it possible to override rules for specific files in TSLINT (tslint.json) like a configuration along those lines:

"overrides": [{
  "files": [ "*.spec.js" ],
  "rules": {
    "no-unused-expressions": 0
  }
}]

I wouldnt want to set a comment on each file to disable the rules - its redundant.

Upvotes: 3

Views: 2403

Answers (1)

Wayrex
Wayrex

Reputation: 2107

Update 2021;

Nowadays TSLint is deprecated and eslint should be used instead, but TSLint did support overriding rules for sub-directory, like:

{
    "extends": "../tslint.json",
    
    ...
}

See: https://stackoverflow.com/a/53715541/8740349

Old answer

Seems like the only option so far is to disable them using the comment functionality.

Upvotes: 4

Related Questions