Closed getify closed 5 years ago
I don't understand why using arrow function in top/global scope or as export is an issue. For me, the main issue is using this
in arrow function in these case and more exactly a top-level this
.
For example, I can export an arrow function like that (dumb functions xD) and I don't see any issue:
export const
error = (msg) => console.error(msg),
warn = (msg) => console.warn(msg),
info = (msg) => console.info(msg);
export default (msg) => console.log(msg);
Another example, One of my usage of arrow function is an export with simple and dumb arrow function for mapping data.
For object properties... I can understand for literal object
and I think you speak about that.
This rule disallows arrow functions in various locations (of course each is configurable):
export
expression