ESLint and Prettier lines formatting issue

Completed

Hi guys! My IDE (JetBrain WebStorm, macOS) consider the code snippet at the screenshot below as a wrong formatted one:

https://i.stack.imgur.com/gA8aH.png

 

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>
);

```

Also, my core .gitconfig file has this line:

 

```

autocrlf = input

```

6 comments

What error can you see namely? Please hover over the highlighted lines and take a screenshot of the error tooltip

0

Hi Elena, thanks a lot for your reply!

This hint does not contain any related rule. It just shows a common hint with an action which has to be executed.

0

Are you using eslint-plugin-prettier? What is a result of running eslint in terminal?

0

Elena, thanks again for your efforts!

The issue is actually resolved by recloning the repo )

Also I configured global .gitconfig file with this string:

autocrlf = true (instead of autocrlf = input as it was before).

Please mark this issue as resolved ('cuz I'm n00b in this forum and dunno how to do that :))

0

Please sign in to leave a comment.