tslint-eslint-rules

raw JSON →
5.4.0 verified Sat Apr 25 auth: no javascript

tslint-eslint-rules provides ESLint rules as TSLint plugins, allowing developers to use familiar ESLint linting rules within the TSLint ecosystem for TypeScript projects. The current stable version is 5.4.0, released with peer dependencies on tslint ^5.0.0 and TypeScript ^2.2.0 or ^3.0.0. The project is actively maintained and includes over 50 rules covering possible errors, best practices, and stylistic concerns. It differentiates from alternatives by bridging the gap between ESLint and TSLint, offering a familiar rule set for teams migrating or combining tools.

error Could not find rule: 'no-constant-condition'
cause The rule is not enabled or the plugin is not extended correctly.
fix
Ensure tslint.json extends 'tslint-eslint-rules' and the rule name is spelled correctly.
error Require statement not part of import statement
cause Mixing CommonJS require with TypeScript modules.
fix
Use ES module imports: import * as rules from 'tslint-eslint-rules';
breaking Version 4.0.0 dropped support for TypeScript < 2.2 and tslint < 5.0.0.
fix Update TypeScript to ^2.2.0 and tslint to ^5.0.0.
deprecated TSLint is deprecated in favor of ESLint with typescript-eslint parser. This package may not receive further updates.
fix Migrate to ESLint with @typescript-eslint/parser and @typescript-eslint/eslint-plugin.
gotcha Rule names in tslint-eslint-rules use camelCase instead of kebab-case used in ESLint.
fix Use camelCase rule names, e.g., 'noConstantCondition' but note the package uses native ESLint names? Actually, the rules are named with kebab-case in the JSON configuration. Check docs.
npm install tslint-eslint-rules
yarn add tslint-eslint-rules
pnpm add tslint-eslint-rules

Shows how to extend tslint-eslint-rules in tslint.json and enable two rules with boolean true.

// tslint.json
{
  "extends": ["tslint-eslint-rules"],
  "rules": {
    "no-constant-condition": true,
    "no-control-regex": true
  }
}