Registry / testing / tslint-eslint-rules

tslint-eslint-rules

JSON →
library5.4.0jsnpmunverified

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.

npm install tslint-eslint-rules
INSTALL
IMPORT
SIG · TSLINT-ESLINT-RULE
T
tslint-eslint-rules
testingjavascriptv5.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tslint-eslint-rules
extends: ['tslint-eslint-rules']
extends: 'tslint-eslint-rules'
In tslint.json, use an array to extend. Using a string may not resolve correctly.
no-constant-condition
"no-constant-condition": true
"no-constant-condition": "error"
TSLint rules use boolean or object, not strings like ESLint. Use true/false or an options object.
no-control-regex
"no-control-regex": true
"no-control-regex": "warn"
Severity levels in TSLint are not strings; use true or object for config.

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 } }
Debug
Known issues
breakingVersion 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.
affects: >=4.0.0
deprecatedTSLint 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.
affects: *
gotchaRule 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.
affects: *
Errors
Common errors & fixes
Could not find rule: 'no-constant-condition'
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.
Require statement not part of import statement
Mixing CommonJS require with TypeScript modules.
fix
Use ES module imports: import * as rules from 'tslint-eslint-rules';
Upgrade
Version history
5.4.0latest on npm
Audit
Dependencies
tslintrequiredRequired as a peer dependency; the plugin extends TSLint's rule system.
typescriptrequiredRequired as a peer dependency; needed for type-checking rules.
Agent activity
6 hits · last 30 days
node
6
Resources
tslint-eslint-rules — npm install tslint-eslint-rules · libregistry