![](/img/trans.png)
[英]How to discriminate JSON code formatting by removing empty lines using Eslint + Prettier
[英]Eslint and Prettier lines formatting issue
谁遇到过同样的问题? 我的 IDE(JetBrain WebStorm,macOS)认为下面屏幕截图中的代码片段格式错误:
但是我的队友在 Windows 上有 JetBrains IntelliJ IDEA,并且相同的代码对于相同的 linter 是可以的!
我们对 linter 使用相同的环境(.eslintrc、.prettierrc、.editorconfig 等)。 同时,我的 IDE 没有引用它尝试使用的规则,它只是向我显示了这个提示:
ESLint: Insert
⏎····· (prettier/prettier)
你知道它是什么吗?
代码在这里(JSX,React):
const DBFieldInfoBlock = ({
rowClassName,
cellLabelClassName,
cellValueClassName,
id,
value,
currency,
}) => (
<div className={rowClassName}>
<span className={cellLabelClassName}>
<InfoLabel id={id} />:
</span>
{value !== undefined && value !== null && (
<span className={cellValueClassName}>
<InfoValue value={value} id={id} currency={currency} />
</span>
)}
</div>
);
解决。 伙计们,也许这对某人有帮助。 我进行了以下步骤:
就是这样!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.