我有一些eslint和prettier的配置。当我按下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规则,也不想禁用prettier格式。我怎样才能更改prettier规则以放置逻辑运算符?