eslint-plugin-no-floating-promise
eslint-plugin-no-floating-promise copied to clipboard
Option to ignore await if a function call at the end of scope
If I have a function that has at the end of it a promise. Example
document.getElementById('button').addEventListener('click', () => {
// do stuff
asynFunc();
});
I want to ignore cases like this. In other words I don't want to add await for asyncFunc()
because it is the last thing run in the callback function and no need to await.
Is there an option to ignore. Maybe something look like this in eslint rules
"no-floating-promise/no-floating-promise": ["warn", { "ignoreLast": true }],