Rule proposal: Forbid functions that do not take parameters.
Functions that do not take parameters are either
using arguments to do some odd behavior. There is a different rule for that, but still
has side-causes : uses variables besides closure variables or parameters
always return the same value: The function call could be replaced by the value itself.
I do wonder about methods that are not assigned, like for the following example
const count = values
.map(() => 1)
.reduce((a, b) => a + b, 0);
This should be allowed, and I think that having the function not be assigned and not declared on its own (i.e., passed as an expression) should be allowed, but I'm not sure whether this should be behind a flag or not.
If people are watching, would gladly get some feedback on this :)
Rule proposal: Forbid functions that do not take parameters.
Functions that do not take parameters are either
arguments
to do some odd behavior. There is a different rule for that, but stillI do wonder about methods that are not assigned, like for the following example
This should be allowed, and I think that having the function not be assigned and not declared on its own (i.e., passed as an expression) should be allowed, but I'm not sure whether this should be behind a flag or not.
If people are watching, would gladly get some feedback on this :)