Skip to main content

ban-tslint-comment

Disallow // tslint:<rule-flag> comments.

Useful when migrating from TSLint to ESLint. Once TSLint has been removed, this rule helps locate TSLint annotations (e.g. // tslint:disable).

Attributes

  • Included in configs
    • ✅ Recommended
    • 🔒 Strict
  • Fixable
    • 🔧 Automated Fixer
    • 🛠 Suggestion Fixer
  • 💭 Requires type information

Rule Details

All TSLint rule flags

/* tslint:disable */
/* tslint:enable */
/* tslint:disable:rule1 rule2 rule3... */
/* tslint:enable:rule1 rule2 rule3... */
// tslint:disable-next-line
someCode(); // tslint:disable-line
// tslint:disable-next-line:rule1 rule2 rule3...

Options

// .eslintrc.json
{
"rules": {
"@typescript-eslint/ban-tslint-comment": "warn"
}
}

This rule is not configurable.

When Not To Use It

If you are still using TSLint.