sbdchd / eslint-plugin-cake

:cake: Sweet rules for ESLint
MIT License
1 stars 0 forks source link

new rule: no unnecessary lambda #27

Open chdsbd opened 3 years ago

chdsbd commented 3 years ago
function foo() {}

# bad
sendMessage({cb: () => foo()})

# okay
sendMessage({cb: foo})
chdsbd commented 3 years ago

TSLint has this: https://palantir.github.io/tslint/rules/no-unnecessary-callback-wrapper/

There's this ESLint package: https://github.com/jonaskello/eslint-plugin-functional/blob/master/docs/rules/prefer-tacit.md