Package Exports
- tslint-eslint-rules
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tslint-eslint-rules) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ESLint rules for TSLint
Improve your TSLint with the missing ESLint Rules
You want to code in TypeScript but miss all the rules available in ESLint?
Now you can combine both worlds by using this TSLint plugin!
WARN: this project is still under development.
You can see what see what rules were already migrated migrated in the eslint_tsling.json file
Usage TODO
Install from NPM to your Dev Dependencies
npm install --save-dev tsling-eslint-rules
In your tslint.json
file, insert the rules as described below.
Rules (copied from ESLint website)
The list below shows all the existing ESLint rules and the similar rules available in TSLint.
Possible Errors
The following rules point out areas where you might have made mistakes.
comma-dangle => trailing-comma (native)
Description: disallow or enforce trailing commas (recommended)
Usage
"trailing-comma": [ true, { "multiline": "always", "singleline": "never" } ]
no-cond-assign => no-conditional-assignment (native)
Description: disallow assignment in conditional expressions (recommended)
Usage
"no-conditional-assignment": true
no-console => no-console (native)
Description: disallow use of
console
in the node environment (recommended)Usage
"no-console": [ true, "debug", "info", "time", "timeEnd", "trace" ]
no-constant-condition => no-constant-condition (tslint-eslint-rules)
Description: disallow use of constant expressions in conditions (recommended)
Usage
"no-constant-condition": true
no-control-regex => no-control-regex (tslint-eslint-rules) TODO
Description: disallow control characters in regular expressions (recommended)
Usage
"no-control-regex": true
no-debugger => no-debugger (native)
Description: disallow use of
debugger
(recommended)Usage
"no-debugger": true
no-dupe-args => not applicable to TypeScript
- Description: disallow duplicate arguments in functions (recommended)
no-dupe-keys => no-duplicate-key (native)
Description: disallow duplicate keys when creating object literals (recommended)
Usage
"no-duplicate-key": true
no-duplicate-case => no-duplicate-case (tslint-eslint-rules)
Description: disallow a duplicate case label. (recommended)
Usage
"no-duplicate-case": true
no-empty-character-class => no-empty-character-class (tslint-eslint-rules) TODO
Description: disallow the use of empty character classes in regular expressions (recommended)
Usage
"no-empty-character-class": true
no-empty => no-empty (native)
Description: disallow empty statements (recommended)
Usage
"no-empty": true
no-ex-assign => no-ex-assign (tslint-eslint-rules) TODO
Description: disallow assigning to the exception in a
catch
block (recommended)Usage
"no-ex-assign": true
no-extra-boolean-cast => no-extra-boolean-cast (tslint-eslint-rules) TODO
Description: disallow double-negation boolean casts in a boolean context (recommended)
Usage
"no-extra-boolean-cast": true
no-extra-parens => no-extra-parens (tslint-eslint-rules) TODO (low priority)
Description: disallow unnecessary parentheses
Usage
"no-extra-parens": [ true, "functions" ]
"no-extra-parens": [ true, "all" ]
no-extra-semi => no-extra-semi (tslint-eslint-rules)
Description: disallow unnecessary semicolons (recommended)
Usage
"no-extra-semi": true
no-func-assign => not applicable to TypeScript
- Description: disallow overwriting functions written as function declarations (recommended)
no-inner-declarations => no-inner-declarations (tslint-eslint-rules) TODO
Description: disallow function or variable declarations in nested blocks (recommended)
Usage
"no-inner-declarations": [ true, "functions" ]
"no-inner-declarations": [ true, "both" ]
no-invalid-regexp => no-invalid-regex (tslint-eslint-rules) TODO
Description: disallow invalid regular expression strings in the
RegExp
constructor (recommended)Usage
"no-invalid-regexp": true
no-irregular-whitespace => no-irregular-whitespace (tslint-eslint-rules) TODO
Description: disallow irregular whitespace outside of strings and comments (recommended)
Usage
"no-irregular-whitespace": true
no-negated-in-lhs => not applicable to TypeScript
- Description: disallow negation of the left operand of an
in
expression (recommended)
- Description: disallow negation of the left operand of an
no-obj-calls => not applicable to TypeScript
- Description: disallow the use of object properties of the global object (
Math
andJSON
) as functions (recommended)
- Description: disallow the use of object properties of the global object (
no-regex-spaces => no-regex-spaces (tslint-eslint-rules) TODO
Description: disallow multiple spaces in a regular expression literal (recommended)
Usage
"no-regex-spaces": true
no-sparse-arrays => no-sparse-arrays (tslint-eslint-rules)
Description: disallow sparse arrays (recommended)
Usage
"no-sparse-arrays": true
no-unexpected-multiline => no-unexpected-multiline (tslint-eslint-rules) TODO
Description: Avoid code that looks like two expressions but is actually one
Usage
"no-unexpected-multiline": true
no-unreachable => no-unreachable (native)
Description: disallow unreachable statements after a return, throw, continue, or break statement (recommended)
Usage
"no-unreachable": true
use-isnan => use-isnan (tslint-eslint-rules)
Description: disallow comparisons with the value
NaN
(recommended)Usage
"use-isnan": true
valid-jsdoc => valid-jsdoc (tslint-eslint-rules) TODO
Description: Ensure JSDoc comments are valid
Usage
"valid-jsdoc": [ true, { "prefer": { "return": "returns" }, "requireReturn": false, "requireParamDescription": true, "requireReturnDescription": true, "matchDescription": "^[A-Z][A-Za-z0-9\\s]*[.]$" } ]
valid-typeof => valid-typeof (tslint-eslint-rules)
Description: Ensure that the results of typeof are compared against a valid string (recommended)
Usage
"valid-typeof": true
Best Practices
These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns.
- accessor-pairs =>
Description: Enforces getter/setter pairs in objects
Usage
"accessor-pairs": [ true, { } ]
- block-scoped-var =>
Description: treat
var
statements as if they were block scopedUsage
"block-scoped-var": [ true, { } ]
- complexity =>
Description: specify the maximum cyclomatic complexity allowed in a program
Usage
"complexity": [ true, { } ]
- consistent-return =>
Description: require
return
statements to either always or never specify valuesUsage
"consistent-return": [ true, { } ]
- curly =>
Description: specify curly brace conventions for all control statements
Usage
"curly": [ true, { } ]
- default-case =>
Description: require
default
case inswitch
statementsUsage
"default-case": [ true, { } ]
- dot-location =>
Description: enforces consistent newlines before or after dots
Usage
"dot-location": [ true, { } ]
- dot-notation =>
Description: encourages use of dot notation whenever possible
Usage
"dot-notation": [ true, { } ]
- eqeqeq =>
Description: require the use of
===
and!==
Usage
"eqeqeq": [ true, { } ]
- guard-for-in =>
Description: make sure
for-in
loops have anif
statementUsage
"guard-for-in": [ true, { } ]
- no-alert =>
Description: disallow the use of
alert
,confirm
, andprompt
Usage
"no-alert": [ true, { } ]
- no-caller =>
Description: disallow use of
arguments.caller
orarguments.callee
Usage
"no-caller": [ true, { } ]
- no-case-declarations =>
Description: disallow lexical declarations in case clauses
Usage
"no-case-declarations": [ true, { } ]
- no-div-regex =>
Description: disallow division operators explicitly at beginning of regular expression
Usage
"no-div-regex": [ true, { } ]
- no-else-return =>
Description: disallow
else
after areturn
in anif
Usage
"no-else-return": [ true, { } ]
- no-empty-label =>
Description: disallow use of labels for anything other than loops and switches
Usage
"no-empty-label": [ true, { } ]
- no-empty-pattern =>
Description: disallow use of empty destructuring patterns
Usage
"no-empty-pattern": [ true, { } ]
- no-eq-null =>
Description: disallow comparisons to null without a type-checking operator
Usage
"no-eq-null": [ true, { } ]
- no-eval =>
Description: disallow use of
eval()
Usage
"no-eval": [ true, { } ]
- no-extend-native =>
Description: disallow adding to native types
Usage
"no-extend-native": [ true, { } ]
- no-extra-bind =>
Description: disallow unnecessary function binding
Usage
"no-extra-bind": [ true, { } ]
- no-fallthrough =>
Description: disallow fallthrough of
case
statements (recommended)Usage
"no-fallthrough": [ true, { } ]
- no-floating-decimal =>
Description: disallow the use of leading or trailing decimal points in numeric literals
Usage
"no-floating-decimal": [ true, { } ]
- no-implicit-coercion =>
Description: disallow the type conversions with shorter notations
Usage
"no-implicit-coercion": [ true, { } ]
- no-implied-eval =>
Description: disallow use of
eval()
-like methodsUsage
"no-implied-eval": [ true, { } ]
- no-invalid-this =>
Description: disallow
this
keywords outside of classes or class-like objectsUsage
"no-invalid-this": [ true, { } ]
- no-iterator =>
Description: disallow Usage of
__iterator__
propertyUsage
"no-iterator": [ true, { } ]
- no-labels =>
Description: disallow use of labeled statements
Usage
"no-labels": [ true, { } ]
- no-lone-blocks =>
Description: disallow unnecessary nested blocks
Usage
"no-lone-blocks": [ true, { } ]
- no-loop-func =>
Description: disallow creation of functions within loops
Usage
"no-loop-func": [ true, { } ]
- no-magic-numbers =>
Description: disallow the use of magic numbers
Usage
"no-magic-numbers": [ true, { } ]
- no-multi-spaces =>
Description: disallow use of multiple spaces
Usage
"no-multi-spaces": [ true, { } ]
- no-multi-str =>
Description: disallow use of multiline strings
Usage
"no-multi-str": [ true, { } ]
- no-native-reassign =>
Description: disallow reassignments of native objects
Usage
"no-native-reassign": [ true, { } ]
- no-new-func =>
Description: disallow use of new operator for
Function
objectUsage
"no-new-func": [ true, { } ]
- no-new-wrappers =>
Description: disallows creating new instances of
String
,Number
, andBoolean
Usage
"no-new-wrappers": [ true, { } ]
- no-new =>
Description: disallow use of the
new
operator when not part of an assignment or comparisonUsage
"no-new": [ true, { } ]
- no-octal-escape =>
Description: disallow use of octal escape sequences in string literals, such as
var foo = "Copyright \251";
Usage
"no-octal-escape": [ true, { } ]
- no-octal =>
Description: disallow use of octal literals (recommended)
Usage
"no-octal": [ true, { } ]
- no-param-reassign =>
Description: disallow reassignment of function parameters
Usage
"no-param-reassign": [ true, { } ]
- no-process-env =>
Description: disallow use of
process.env
Usage
"no-process-env": [ true, { } ]
- no-proto =>
Description: disallow Usage of
__proto__
propertyUsage
"no-proto": [ true, { } ]
- no-redeclare =>
Description: disallow declaring the same variable more than once (http://eslint.org/docs/rules/recommended)
Usage
"no-redeclare": [ true, { } ]
- no-return-assign =>
Description: disallow use of assignment in
return
statementUsage
"no-return-assign": [ true, { } ]
- no-script-url =>
Description: disallow use of
javascript:
urls.Usage
"no-script-url": [ true, { } ]
- no-self-compare =>
Description: disallow comparisons where both sides are exactly the same
Usage
"no-self-compare": [ true, { } ]
- no-sequences =>
Description: disallow use of the comma operator
Usage
"no-sequences": [ true, { } ]
- no-throw-literal =>
Description: restrict what can be thrown as an exception
Usage
"no-throw-literal": [ true, { } ]
- no-unused-expressions =>
Description: disallow Usage of expressions in statement position
Usage
"no-unused-expressions": [ true, { } ]
- no-useless-call =>
Description: disallow unnecessary
.call()
and.apply()
Usage
"no-useless-call": [ true, { } ]
- no-useless-concat =>
Description: disallow unnecessary concatenation of literals or template literals
Usage
"no-useless-concat": [ true, { } ]
- no-void =>
Description: disallow use of the
void
operatorUsage
"no-void": [ true, { } ]
- no-warning-comments - disallow Usage
of configurable warning terms in comments =>
Description: e.g.
TODO
orFIXME
Usage
"no-warning-comments": [ true, { } ]
- no-with =>
Description: disallow use of the
with
statementUsage
"no-with": [ true, { } ]
- radix =>
Description: require use of the second argument for
parseInt()
Usage
"radix": [ true, { } ]
- vars-on-top =>
Description: require declaration of all vars at the top of their containing scope
Usage
"vars-on-top": [ true, { } ]
- wrap-iife =>
Description: require immediate function invocation to be wrapped in parentheses
Usage
"wrap-iife": [ true, { } ]
- yoda =>
Description: require or disallow Yoda conditions
Usage
"yoda": [ true, { } ]
Strict Mode
These rules relate to using strict mode.
- strict =>
Description: controls location of Use Strict Directives
Usage
"strict": [ true, { } ]
Variables
These rules have to do with variable declarations.
- init-declarations =>
Description: enforce or disallow variable initializations at definition
Usage
"init-declarations": [ true, { } ]
- no-catch-shadow =>
Description: disallow the catch clause parameter name being the same as a variable in the outer scope
Usage
"no-catch-shadow": [ true, { } ]
- no-delete-var =>
Description: disallow deletion of variables (recommended)
Usage
"no-delete-var": [ true, { } ]
- no-label-var =>
Description: disallow labels that share a name with a variable
Usage
"no-label-var": [ true, { } ]
- no-shadow-restricted-names =>
Description: disallow shadowing of names such as
arguments
Usage
"no-shadow-restricted-names": [ true, { } ]
- no-shadow =>
Description: disallow declaration of variables already declared in the outer scope
Usage
"no-shadow": [ true, { } ]
- no-undef-init =>
Description: disallow use of undefined when initializing variables
Usage
"no-undef-init": [ true, { } ]
- no-undef =>
Description: disallow use of undeclared variables unless mentioned in a
/*global */
block (recommended)Usage
"no-undef": [ true, { } ]
- no-undefined =>
Description: disallow use of
undefined
variableUsage
"no-undefined": [ true, { } ]
- no-unused-vars =>
Description: disallow declaration of variables that are not used in the code (recommended)
Usage
"no-unused-vars": [ true, { } ]
- no-use-before-define =>
Description: disallow use of variables before they are defined
Usage
"no-use-before-define": [ true, { } ]
Node.js and CommonJS
These rules are specific to JavaScript running on Node.js or using CommonJS in the browser.
- callback-return =>
Description: enforce
return
after a callbackUsage
"callback-return": [ true, { } ]
- global-require =>
Description: enforce
require()
on top-level module scopeUsage
"global-require": [ true, { } ]
- handle-callback-err =>
Description: enforce error handling in callbacks
Usage
"handle-callback-err": [ true, { } ]
- no-mixed-requires =>
Description: disallow mixing regular variable and require declarations
Usage
"no-mixed-requires": [ true, { } ]
- no-new-require =>
Description: disallow use of
new
operator with therequire
functionUsage
"no-new-require": [ true, { } ]
- no-path-concat =>
Description: disallow string concatenation with
__dirname
and__filename
Usage
"no-path-concat": [ true, { } ]
- no-process-exit =>
Description: disallow
process.exit()
Usage
"no-process-exit": [ true, { } ]
- no-restricted-modules =>
Description: restrict Usage of specified node modules
Usage
"no-restricted-modules": [ true, { } ]
- no-sync =>
Description: disallow use of synchronous methods
Usage
"no-sync": [ true, { } ]
Stylistic Issues
These rules are purely matters of style and are quite subjective.
- array-bracket-spacing =>
Description: enforce spacing inside array brackets
Usage
"array-bracket-spacing": [ true, { } ]
- block-spacing =>
Description: disallow or enforce spaces inside of single line blocks
Usage
"block-spacing": [ true, { } ]
- brace-style =>
Description: enforce one true brace style
Usage
"brace-style": [ true, { } ]
- camelcase =>
Description: require camel case names
Usage
"camelcase": [ true, { } ]
- comma-spacing =>
Description: enforce spacing before and after comma
Usage
"comma-spacing": [ true, { } ]
- comma-style =>
Description: enforce one true comma style
Usage
"comma-style": [ true, { } ]
- computed-property-spacing =>
Description: require or disallow padding inside computed properties
Usage
"computed-property-spacing": [ true, { } ]
- consistent-this =>
Description: enforce consistent naming when capturing the current execution context
Usage
"consistent-this": [ true, { } ]
- eol-last =>
Description: enforce newline at the end of file, with no multiple empty lines
Usage
"eol-last": [ true, { } ]
- func-names =>
Description: require function expressions to have a name
Usage
"func-names": [ true, { } ]
- func-style =>
Description: enforce use of function declarations or expressions
Usage
"func-style": [ true, { } ]
- id-length =>
Description: this option enforces minimum and maximum identifier lengths (variable names, property names etc.)
Usage
"id-length": [ true, { } ]
- id-match =>
Description: require identifiers to match the provided regular expression
Usage
"id-match": [ true, { } ]
- indent =>
Description: specify tab or space width for your code
Usage
"indent": [ true, { } ]
- jsx-quotes =>
Description: specify whether double or single quotes should be used in JSX attributes
Usage
"jsx-quotes": [ true, { } ]
- key-spacing =>
Description: enforce spacing between keys and values in object literal properties
Usage
"key-spacing": [ true, { } ]
- linebreak-style =>
Description: disallow mixed 'LF' and 'CRLF' as linebreaks
Usage
"linebreak-style": [ true, { } ]
- lines-around-comment =>
Description: enforce empty lines around comments
Usage
"lines-around-comment": [ true, { } ]
- max-nested-callbacks =>
Description: specify the maximum depth callbacks can be nested
Usage
"max-nested-callbacks": [ true, { } ]
- new-cap =>
Description: require a capital letter for constructors
Usage
"new-cap": [ true, { } ]
- new-parens =>
Description: disallow the omission of parentheses when invoking a constructor with no arguments
Usage
"new-parens": [ true, { } ]
- newline-after-var =>
Description: require or disallow an empty newline after variable declarations
Usage
"newline-after-var": [ true, { } ]
- no-array-constructor =>
Description: disallow use of the
Array
constructorUsage
"no-array-constructor": [ true, { } ]
- no-continue =>
Description: disallow use of the
continue
statementUsage
"no-continue": [ true, { } ]
- no-inline-comments =>
Description: disallow comments inline after code
Usage
"no-inline-comments": [ true, { } ]
- no-lonely-if =>
Description: disallow
if
as the only statement in anelse
blockUsage
"no-lonely-if": [ true, { } ]
- no-mixed-spaces-and-tabs =>
Description: disallow mixed spaces and tabs for indentation (recommended)
Usage
"no-mixed-spaces-and-tabs": [ true, { } ]
- no-multiple-empty-lines =>
Description: disallow multiple empty lines
Usage
"no-multiple-empty-lines": [ true, { } ]
- no-negated-condition =>
Description: disallow negated conditions
Usage
"no-negated-condition": [ true, { } ]
- no-nested-ternary =>
Description: disallow nested ternary expressions
Usage
"no-nested-ternary": [ true, { } ]
- no-new-object =>
Description: disallow the use of the
Object
constructorUsage
"no-new-object": [ true, { } ]
- no-restricted-syntax =>
Description: disallow use of certain syntax in code
Usage
"no-restricted-syntax": [ true, { } ]
- no-spaced-func =>
Description: disallow space between function identifier and application
Usage
"no-spaced-func": [ true, { } ]
- no-ternary =>
Description: disallow the use of ternary operators
Usage
"no-ternary": [ true, { } ]
- no-trailing-spaces =>
Description: disallow trailing whitespace at the end of lines
Usage
"no-trailing-spaces": [ true, { } ]
- no-underscore-dangle =>
Description: disallow dangling underscores in identifiers
Usage
"no-underscore-dangle": [ true, { } ]
- no-unneeded-ternary =>
Description: disallow the use of ternary operators when a simpler alternative exists
Usage
"no-unneeded-ternary": [ true, { } ]
- object-curly-spacing =>
Description: require or disallow padding inside curly braces
Usage
"object-curly-spacing": [ true, { } ]
- one-var =>
Description: require or disallow one variable declaration per function
Usage
"one-var": [ true, { } ]
- operator-assignment =>
Description: require assignment operator shorthand where possible or prohibit it entirely
Usage
"operator-assignment": [ true, { } ]
- operator-linebreak =>
Description: enforce operators to be placed before or after line breaks
Usage
"operator-linebreak": [ true, { } ]
- padded-blocks =>
Description: enforce padding within blocks
Usage
"padded-blocks": [ true, { } ]
- quote-props =>
Description: require quotes around object literal property names
Usage
"quote-props": [ true, { } ]
- quotes =>
Description: specify whether backticks, double or single quotes should be used
Usage
"quotes": [ true, { } ]
- require-jsdoc =>
Description: Require JSDoc comment
Usage
"require-jsdoc": [ true, { } ]
- semi-spacing =>
Description: enforce spacing before and after semicolons
Usage
"semi-spacing": [ true, { } ]
- semi =>
Description: require or disallow use of semicolons instead of ASI
Usage
"semi": [ true, { } ]
- sort-vars =>
Description: sort variables within the same declaration block
Usage
"sort-vars": [ true, { } ]
- space-after-keywords =>
Description: require a space after certain keywords
Usage
"space-after-keywords": [ true, { } ]
- space-before-blocks =>
Description: require or disallow a space before blocks
Usage
"space-before-blocks": [ true, { } ]
- space-before-function-paren =>
Description: require or disallow a space before function opening parenthesis
Usage
"space-before-function-paren": [ true, { } ]
- space-before-keywords =>
Description: require a space before certain keywords
Usage
"space-before-keywords": [ true, { } ]
- space-in-parens =>
Description: require or disallow spaces inside parentheses
Usage
"space-in-parens": [ true, { } ]
- space-infix-ops =>
Description: require spaces around operators
Usage
"space-infix-ops": [ true, { } ]
- space-return-throw-case =>
Description: require a space after
return
,throw
, andcase
Usage
"space-return-throw-case": [ true, { } ]
- space-unary-ops =>
Description: require or disallow spaces before/after unary operators
Usage
"space-unary-ops": [ true, { } ]
- spaced-comment =>
Description: require or disallow a space immediately following the
//
or/*
in a commentUsage
"spaced-comment": [ true, { } ]
- wrap-regex =>
Description: require regex literals to be wrapped in parentheses
Usage
"wrap-regex": [ true, { } ]
ECMAScript 6
These rules are only relevant to ES6 environments.
- arrow-body-style =>
Description: require braces in arrow function body
Usage
"arrow-body-style": [ true, { } ]
- arrow-parens =>
Description: require parens in arrow function arguments
Usage
"arrow-parens": [ true, { } ]
- arrow-spacing =>
Description: require space before/after arrow function's arrow
Usage
"arrow-spacing": [ true, { } ]
- constructor-super =>
Description: verify calls of
super()
in constructorsUsage
"constructor-super": [ true, { } ]
- generator-star-spacing =>
Description: enforce spacing around the
*
in generator functionsUsage
"generator-star-spacing": [ true, { } ]
- no-arrow-condition =>
Description: disallow arrow functions where a condition is expected
Usage
"no-arrow-condition": [ true, { } ]
- no-class-assign =>
Description: disallow modifying variables of class declarations
Usage
"no-class-assign": [ true, { } ]
- no-const-assign =>
Description: disallow modifying variables that are declared using
const
Usage
"no-const-assign": [ true, { } ]
- no-dupe-class-members =>
Description: disallow duplicate name in class members
Usage
"no-dupe-class-members": [ true, { } ]
- no-this-before-super =>
Description: disallow use of
this
/super
before callingsuper()
in constructors.Usage
"no-this-before-super": [ true, { } ]
- no-var =>
Description: require
let
orconst
instead ofvar
Usage
"no-var": [ true, { } ]
- object-shorthand =>
Description: require method and property shorthand syntax for object literals
Usage
"object-shorthand": [ true, { } ]
- prefer-arrow-callback =>
Description: suggest using arrow functions as callbacks
Usage
"prefer-arrow-callback": [ true, { } ]
- prefer-const =>
Description: suggest using
const
declaration for variables that are never modified after declaredUsage
"prefer-const": [ true, { } ]
- prefer-reflect =>
Description: suggest using Reflect methods where applicable
Usage
"prefer-reflect": [ true, { } ]
- prefer-spread =>
Description: suggest using the spread operator instead of
.apply()
.Usage
"prefer-spread": [ true, { } ]
- prefer-template =>
Description: suggest using template literals instead of strings concatenation
Usage
"prefer-template": [ true, { } ]
- require-yield =>
Description: disallow generator functions that do not have
yield
Usage
"require-yield": [ true, { } ]
Legacy
The following rules are included for compatibility with JSHint and JSLint. While the names of the rules may not match up with the JSHint/JSLint counterpart, the functionality is the same.
- max-depth =>
Description: specify the maximum depth that blocks can be nested
Usage
"max-depth": [ true, { } ]
- max-len =>
Description: specify the maximum length of a line in your program
Usage
"max-len": [ true, { } ]
- max-params =>
Description: limits the number of parameters that can be used in the function declaration.
Usage
"max-params": [ true, { } ]
- max-statements =>
Description: specify the maximum number of statement allowed in a function
Usage
"max-statements": [ true, { } ]
- no-bitwise =>
Description: disallow use of bitwise operators
Usage
"no-bitwise": [ true, { } ]
- no-plusplus =>
Description: disallow use of unary operators,
++
and--
Usage
"no-plusplus": [ true, { } ]
Contributing
Bugs, rules requests, doubts etc., open a Github Issue.
If you didn't find the rule, you can also create an ESLint custom rule for TSLint:
- Forking this repo
- Run
npm isntall
- Run
gulp
to run the tests and watch for file changes - Create your rule tests at
./src/test/rules
and your rule in./src/rules
with the convetion:- Name: rule-name (hyphenated)
- File: ruleNameRule.ts (camelCased and with the
Rule
suffix) - Test File: ruleNameRuleTests.ts (camelCased and with the
RuleTests
suffix)
- Check if all the tests are passing
- Commit the changes to your repo and open a Pull Request
LICENSE
MIT