prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.41k stars 254 forks source link

eslint rule contradiction with prettier #47

Closed fehergeri13 closed 6 years ago

fehergeri13 commented 6 years ago

When I write this code:

const { caretPosition: [selectionStart, selectionEnd] } = this.state;

the prettier reformats it to

const {
  caretPosition: [selectionStart, selectionEnd]
} = this.state;

live demo

But the eslint wants it to be a single line.

image

image

package.json

...
    "babel-eslint": "^7.2.3",
...
    "eslint": "^4.13.1",
    "eslint-config-prettier": "^2.9.0",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-prettier": "^2.4.0",
    "eslint-plugin-react": "^7.5.1",
...
    "prettier": "^1.9.2",
lydell commented 6 years ago

Hi! I’m sorry, but I don’t really understand your problem. You seem to be running Prettier through ESLint via eslint-plugin-prettier? So eslint --fix should do what you want?

Could you make an example repo that demonstrates your issue?

Also note that you use an older version of Prettier while the playground runs the latest version.

fehergeri13 commented 6 years ago

Upgrading the dependencies fixed the issue