Ugly positioning for promise then/catch
This change makes the code harder to follow.

Input:
dispatch(RequestsDuck.submitRequestComment(id, { text, files }))
.then(() => this.setState({text: '', files: [] }))
then takes up one line and is self contained.
Output:
dispatch(RequestsDuck.submitRequestComment(id, { text, files })).then(() =>
this.setState({ text: '', files: [] })
);
then takes up three lines, starts at the end of another functionality and is overall harder to follow.
Expected behavior:
Expected is that .then starts the new line so that it is more clear and easier to follow the chain, instead of having to look at the end of a line.
Ugly Position for .catch:
Input:
const token = await psApi
.tokenAsync(formRef.current)
.catch(errors => {
// do something with errors
return null;
});
Output:
const token = await psApi.tokenAsync(formRef.current).catch(erros => {
// do something with errors
return null;
});
Expected behavior:
.catch should be a "header" for a reject callback to make reject handling obvious.
Better -- keep input unchanged. Acceptable:
const token = await psApi.tokenAsync(formRef.current)
.catch(errors => {
// do something with errors
return null;
});
try { ... } catch { ... } is much more verbose then .catch chain call and requires to use let declaration for token.
So vue users can't use prettier because of this ugly feature ?
2024 here, any updates on this?