Linting rules
E020: reserve-mode-literal
Warns when `reserve` mode is passed as numeric literal instead of `RESERVE_MODE_*` constants.
Metadata
Code:E020Rule:reserve-mode-literalStatus: Stable sincev0.0.1Quick fix: sometimes available
What it does
Warns when reserve mode is passed as numeric literal instead of RESERVE_MODE_* constants.
Why is this bad?
Numeric reserve modes are hard to read and easy to misuse. Named constants make intent explicit and reduce mistakes.
Example
reserveToncoinsOnBalance(ton("0.1"), 3);Use instead:
reserveToncoinsOnBalance(ton("0.1"), RESERVE_MODE_ALL_BUT_AMOUNT + RESERVE_MODE_AT_MOST);Last updated on