Glavin001 / Glavin001/tslint-clean-code

prefer-specific-tslint-disable rule

Open
#8 0 comments 0 reactions 1 assignee Claimed by @Glavin001 View on GitHub
rule
Dominant language
TypeScript
Stars
175
Forks
15
PR merge metrics
No merged PRs in 30d

Description

TSLint will filter out / ignore failures when there is a line within the start and end which disables the rule. This would be fine, except `// tslint:disable-line` without specifying a specific rule results in disabling all rules including those which may be failing on a parent node.

For example,

```
class MyClass {
secondMethod() {
console.log("second Method"); // tslint:disable-line
}
firstMethod() {
this.secondMethod();
}
}
```

The newspaper-order rule should fail stating the order should be `[firstMethod, secondMethod]`, however the `console.log("second Method"); // tslint:disable-line` actually disables it!

The following code works as expected:

```
class MyClass {
secondMethod() {
console.log("second Method"); // tslint:disable-line no-console
}
firstMethod() {
this.secondMethod();
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.