Features:
naming-convention
:accessor
is now configurable
Bugfixes:
naming-convention
:filter
option is no longer affect by the order of checked names and caching
Features:
no-unnecessary-else
andno-else-after-return
are now automatically fixable
Bugfixes:
- fixed version of
tsutils
dependency
Features:
early-exit
: added option"ignore-constructor"
Bugfixes:
no-unused
: don't mark import ofReact
as unused if required by JsxFragment
Bugfixes:
no-unused
: fixed crash on type parameter of declaration inside global augmentation
Bugfixes:
naming-convention
: added missing configuration handling for"type": "parameterProperty"
Features:
no-else-after-return
: added option"allow-else-if"
no-else-after-return
: use correct control flow analysis
no-unnecessary-type-annotation
: fix infinite loop on union with generic signature (#57)
Bugfixes:
no-unnecessary-type-annotations
now recognizes IIFEs that look like(function(param: string) {}('parameter'));
Features:
This package now provides all rules for the Wotan linter runtime as well.
Example .wotanrc.yaml
:
extends:
- tslint-consistent-codestyle # makes rules from the package available with the 'tcc/' prefix
rules: # now configure the rules you want to use, remember to use the 'tcc/' prefix
tcc/no-collapsible-if: error
tcc/no-unused:
options: 'ignore-parameters'
Bugfixes:
ext-curly
: handle LabeledStatement as if it was not present
Non-breaking rule changes: (you might want to amend your configuration to make the rules stricter again)
naming-convention
: Format options"camelCase"
and"PascalCase"
now allow adjacent uppercase characters to make it usable for real-world code. Use the new options"strictCamelCase"
and"StrictPascalCase"
to restore the old strict behavior.no-unnecessary-type-annotation
: disabled checking return type annotations by default as these cause the most false positves. You can enable the check with the new option"check-return-type"
.
Bugfixes:
naming-convention
: fixed a bug where the suffix was not correctly removed from the name when using an array of suffixes.
Features:
naming-convention
: added new type"functionVariable"
.- It matches all variables initialized with an arrow function or function expression.
- It inherits configuration from
"variable"
Bugfixes:
no-accessor-recursion
fixed crash on abstract accessor
Bugfixes:
no-unused
added special handling forReact
implicitly used by JSX
Bugfixes:
no-unnecessary-type-annotation
- avoid infinite recursion for circular type parameters
- fix signature arity calculation
Features:
- new rule
no-accessor-recursion
Bugfixes:
no-unnecessary-type-annotation
- choose correct signature by arity
- correctly handle methods with numeric name
- correctly handle methods with computed names
Bugfixes:
no-unnecessary-type-annotation
- fixed a false positive with typeguard functions
- this rule is no longer considered experimental
Bugfixes:
no-unnecessary-type-annotation
- check return types
- check types in IIFE (immediately invoked function expression)
- check object literal methods with contextual type
- exempt
this
parameters - correctly handle optional parameters
- correctly handle rest parameters
Features:
- new experimental rule
no-unnecessary-type-annotation
naming-convention
addsunused
modifier -> this enables you to allow leading underscore only for unused variables and parametersno-var-before-return
adds option"allow-destructuring"
early-exit
adds special handling for{"max-length": 0}
Bugfixes:
no-as-type-assertion
- Insert fix at the correct position
- Fixed ordering issues in fixer
- The rule disables itself in
.jsx
and.tsx
files
Features:
no-unused
adds option"unused-catch-binding"
to disallow unused catch bindings. Only use this rule if you use TypeScript@2.5.1 or newer
Features:
- new rule
const-parameters
Bugfixes:
prefer-const-enum
bail on string to number conversionno-unused
fixed false positive with index signature
Features:
parameter-properties
adds"trailing"
option
Bugfixes:
no-var-before-return
now detects if variable is used by a closure.prefer-const-enum
is now stable:- Correct handling of scopes
- Handle enums merging with namespace
- Exclude enums in global scope
- Handle string valued enums
- Bugfix for enum used as type
- Stricter checks for initializer
Features:
- ✨ New rule
no-unused
to find dead code and unused declarations. - New rule
early-exit
recommends to use an early exit instead of a longif
block. Big thanks to @andy-hanson for this great contribution.
Features:
- New rule
ext-curly
to enforce consistent use of curly braces.
Bugfixes:
no-var-before-return
now has an exception array destructuring because there could be an iterator being destructured.
Features:
- This package now contains an empty config that can easily be extended using
"extends": ["tslint-consistent-codestyle"]
in yourtslint.json
- Add documentation about the module resolution of
rulesDirectory
Bugfixes:
- Remove
no-curly
rule from package, which is still under development
Features:
naming-convention
: Allow an array of formats
Bugfixes:
naming-convention
:global
modifier now works correctly on functions, classes, enums, etc. Before they were all consideredlocal
- type
function
now correctly inherits from typevariable
instead of getting overridden depending on their ordering - Adding a
filter
to a configuration no longer overrides every other config in the inheritance chain
Features:
naming-convention
: Addfilter
option to config
Breaking Changes:
- Update to tslint@5
- Removed
prefer-static-method
, use tslint'sprefer-function-over-method
instead - PascalCase and camelCase can no longer contain two adjacent uppercase characters
- UPPER_CASE and snake_case can no longer contain two adjacent underscores
Bugfixes:
- Exempt
this
parameter from name checks