Skip to main content

ban-tslint-comment

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

🎨

Extending "plugin:@typescript-eslint/stylistic" in an ESLint configuration enables this rule.

🔧

Some problems reported by this rule are automatically fixable by the --fix ESLint command line option.

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

See the TSLint rule flags docs for reference.

eslint.config.mjs
export default tseslint.config({
rules: {
"@typescript-eslint/ban-tslint-comment": "error"
}
});

Try this rule in the playground ↗

Examples

/* 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...
Open in Playground

Options

This rule is not configurable.

When Not To Use It

If you are still using TSLint alongside ESLint.

Resources