Releases: eslint-functional/eslint-plugin-functional
v5.0.8
v5.0.7
v5.0.6
v5.0.5
v5.0.4
v5.0.3
v5.0.2
v5.0.1
v5.0.0
5.0.0 (2023-01-29)
Overview
It's finally here. With this release, I am happy to announce that we are finally adding the long-awaited support for the Readonly<T> type (#51).
With this change, we are deprecating the rule prefer-readonly-type in favor of two new rules prefer-immutable-types and type-declaration-immutability.
These new rules split the responsibility of enforcing immutability. prefer-immutable-types is all about enforcing that immutable types are used in your runtime code (type annotations), while type-declaration-immutability is all about enforcing the immutability of type declarations (type aliases and interfaces). These rules take a different approach to enforcing immutability than the old prefer-readonly-type rule, so be sure to check each of their documentation files.
prefer-immutable-types is also designed to be a replacement for @typescript-eslint's prefer-readonly-parameter-types as it offers the same functionality plus more.
Dependancies
When updating, be sure to have add these two new dependencies to your project: @typescript-eslint/type-utils @typescript-eslint/utils
Ruleset Changes
We have introduced a new ruleset called strict. This ruleset will enforce the strictest configuration of our rules.
Note: Each rules' default configuration is in its strictest mode.
The recommended ruleset has in turn been made a little less strict.
New Rules
Deprecated Rules
Breaking Changes
Rule and Option
prefer-tacitnow provides suggestions instead of a fixer. In turnallowFixerhas been removed from theassumeTypesoption.
Name Changes
no-method-signature=>prefer-property-signatures.ignoreIfReadonly=>ignoreIfReadonlyWrapped(nowfalseby default).
no-let(unchanged)allowLocalMutation=>allowInFunctions
no-return-void(unchanged)ignoreImplicit=>ignoreInferredTypes
The name of all the rules and options are now plural where appropriate.
no-class=>no-classes.no-conditional-statement=>no-conditional-statements.no-expression-statement=>no-expression-statements.no-loop-statement=>no-loop-statements.no-mixed-type=>no-mixed-types.no-this-expression=>no-this-expressions.no-throw-statement=>no-throw-statements.no-try-statement=>no-try-statements.immutable-data(unchanged)ignoreClass=>ignoreClasses
Rulesets
Name Changes
no-object-orientation=>no-other-paradigms.external-recommendedsplit intoexternal-vanilla-recommendedandexternal-typescript-recommended.
Rule Changes
- The deprecated rule
prefer-readonly-typehas been removed from all rulesets (exceptoff). prefer-property-signatures(formallyno-method-signature) has been moved to thestylisticruleset.no-this-expressionshas been removed from therecommendedandliterulesets.@typescript-eslint/prefer-readonly-parameter-typeshas been removed from list of recommended external rules.
Dependencies
- minimum supported
TypeScriptversion is nowv4.0.2. - minimum supported
Nodeversion is nowv16.10.0.