prettier-vscode: eslintIntegration. Cannot read property 'sync' of undefined

It’s the first time I’m trying to set it up, so I might have skipped something obvious, but can’t figure it out.

After CMD + Shift + P -> Format Document , it shows in the Output tab:

Cannot read property ‘sync’ of undefined image

I just installed the extension today, version 0.24 Settings of the plugin: { “prettier.eslintIntegration”: true }

prettier 1.6.1 eslint 4.8.0 . (installed globally)

.eslintrc content is:

{
    "extends": [
        "plugin:react/recommended"
    ],
    "plugins": [ "react" ],
    "parserOptions": {
        "ecmaVersion": 8,
        "sourceType": "module",
        "ecmaFeatures": {
            "impliedStrict": true,
            "jsx": true
        }
    }
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 9
  • Comments: 23 (10 by maintainers)

Commits related to this issue

Most upvoted comments

npm update -D prettier

ctrl+shift+p -> Reload Window

This should work

Try adding this to workspace settings. { "prettier.eslintIntegration": false} This worked for me

Prettier 1.7.0 has the sync() function that is missing here (1.6.1)

https://github.com/prettier/prettier/commit/088aa71b07bc25bc3640b1e188ec906ef6d17b1b