我有一些 eslint 和漂亮的配置。当我按下 ctrl + s 来保存我的代码时,我的 eslint 试图像这样格式化代码:
(errors.password
&& (errors.password.type === 'minLength'
|| errors.password.type === 'maxLength') && (
<Styled.Error className="invalidForm">
Password must be more than 6 and less then 32 digits
</Styled.Error>
))
|| (errors.password && (
<Styled.Error className="invalidForm">
Password is required
</Styled.Error>
))
紧接着,漂亮的也将代码格式化为:
(errors.password &&
(errors.password.type === 'minLength' ||
errors.password.type === 'maxLength') && (
<Styled.Error className="invalidForm">
Password must be more than 6 and less then 32 digits
</Styled.Error>
)) ||
(errors.password && (
<Styled.Error className="invalidForm">
Password is required
</Styled.Error>
))
我不想改变 eslint 规则,也不想禁用更漂亮的格式。如何更改放置逻辑运算符的更漂亮的规则?