This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
v5.4.0
⭐️ Non-breaking API changes
- The
--type-check
CLI option now only enables checking for compiler errors before linting. It is no longer required to enable rules that use the type checker -- only need to supply--project
now.
🎉 New rules, options, and fixers
- [new-rule]
switch-final-break
(#2804) - [new-rule]
use-default-type-parameter
(#2253) - [new-rule]
binary-expression-operand-order
(#2805) - [new-rule-option]
ban
new options format: allows to specify an optional explanation message for function bans, banning nested methods and using a wildcard for object of a method ban (#2547) - [new-rule-option]
no-duplicate-variable
addscheck-parameters
option to check if variable has the same name as a parameter (#2597) - [new-rule-option]
curly
: "as-needed" option (#2842) - [new-rule-option]
no-unbound-method
add option"ignore-static"
(#2751) - [new-rule-option]
strict-boolean-expressions
addsallow-boolean-or-undefined
(#2820) - [new-fixer]
object-literal-shorthand
can fix longhand methods (#2558)
🛠 Bugfixes & enhancements
- [bugfix]
prefer-object-spread
allows constructor, function and method calls and more as first argument toObject.assign
(#2828) - [bugfix]
no-unbound-method
walker skips past the parent if it is a cast or parenthesized expression (#2838) - [bugfix]
object-literal-shorthand
: fixed suggestion for generator functions (#2558) - [bugfix] Fixed issue with case sensitivity of
no-unused-variable
rule on Windows (#2819) - [bugfix] don't crash
tslint --project
ifallowJs
is set in tsconfig.json (#2823) - [bugfix]
align
with option"members"
: check members of class expressions; don't check semicolons in classes (#2668) - [bugfix]
no-inferred-empty-object-type
: fix stack overflow (#2762) - [bugfix]
semicolon
: don't warn about unnecesary semicolon when it is actually needed, e.g. when followed by type assertion or template string (#2655) - [bugfix]
space-before-function-paren
: Ignore async arrow function with no parentheses (#2833) - [bugfix]:
no-unsafe-any
: Don't fail oncontinue label;
(#2830) - [bugfix]
no-unbound-method
: Allow unbound method to be used as a condition (#2834) - [bugfix]
no-unsafe-any
: Allow to switch on a value of typeany
(#2836) - [bugfix]
no-unsafe-any
: Don't markdeclare global {}
as an unsafe any. (#2839) - [bugfix]
indent
now checks indentation of expressions inside template strings (#2826) - [enhancement]
--project
(or-p
) enables rules that require the type checker.--type-check
only checks for errors before linting is no longer required (#2773) - [enhancement]
deprecation
: error message includes deprecation text if available (#2748) - [enhancement]
cyclomatic-complexity
: Don't count empty switch case(#2743) - [enhancement]
strict-boolean-expressions
: Allowany
, andtrue
andfalse
literal types (#2758) - [enhancement]
no-floating-promises
: Allow 'promise.catch()' (#2774) - [enhancement]
comment-format
no longer excludes comments with triple slash from linting except/// <reference path="..."/>
(#2616) - [enhancement]
prefer-object-spread
: lint more locations where return value is used. (#2828) - [enhancement]
semicolon
: option"never"
is now spec compliant (#2655) - [enhancement]
object-literal-shorthand
handles async functions correctly (#2558) - [enhancement]
--test
CLI option: allow passing path to tslint.json (#2784) - [enhancement] Use commander instead of optimist for CLI arguments (#2689)
- [enhancement]
strict-type-predicates
: warn if strictNullChecks is not enabled (#2786)
Thanks to our contributors!
- Klaus Meinhardt
- Manuel Lopez
- Andy Hanson
- Piotr Tomiak