简体   繁体   中英

Eslint and Prettier lines formatting issue

who faced with same issue? My IDE (JetBrain WebStorm, macOS) consider the code snippet at the screenshot below as a wrong formatted one:

在此处输入图片说明

But my teammate has JetBrains IntelliJ IDEA on Windows, and the same code is OK for the same linter!

We use the same environment for linters (.eslintrc, .prettierrc, .editorconfig, etc.). In the same time, my IDE does not refer to the rule it's trying to use, it just shows me this hint:

ESLint: Insert ⏎····· (prettier/prettier)

Do you know what can it be?

The code is here (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>
);

Resolved. Guys, perhaps it will be helpful for someone. I proceeded following steps:

  1. Delete the repo.
  2. Clone the repo again.

That's it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM