Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier 2 released, breaks XO #441

Closed
jonahsnider opened this issue Mar 22, 2020 · 6 comments · Fixed by #458
Closed

Prettier 2 released, breaks XO #441

jonahsnider opened this issue Mar 22, 2020 · 6 comments · Fixed by #458

Comments

@jonahsnider
Copy link
Contributor

After upgrading Prettier to v2.0.1 XO started crashing:

$ xo --fix
Error: Failed to load plugin 'prettier' declared in 'CLIOptions': Cannot find module 'eslint-plugin-prettier'
Require stack:
- /project/__placeholder__.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.resolve (internal/modules/cjs/helpers.js:83:19)
    at Object.resolve (/project/node_modules/eslint/lib/shared/relative-module-resolver.js:44:50)
    at ConfigArrayFactory._loadPlugin (/project/node_modules/eslint/lib/cli-engine/config-array-factory.js:959:39)
    at /project/node_modules/eslint/lib/cli-engine/config-array-factory.js:848:33
    at Array.reduce (<anonymous>)
    at ConfigArrayFactory._loadPlugins (/project/node_modules/eslint/lib/cli-engine/config-array-factory.js:844:22)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/project/node_modules/eslint/lib/cli-engine/config-array-factory.js:667:32)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/project/node_modules/eslint/lib/cli-engine/config-array-factory.js:596:20)
@pvdlg
Copy link
Contributor

pvdlg commented Mar 25, 2020

We haven't migrated to Prettier 2 yet.

You shouldn't have prettier as a dependency of your project. XO already defines prettier ass it's own dependency with the version that we support for now.

@jonahsnider
Copy link
Contributor Author

What about projects (like mine) that use Prettier to format non JavaScript files (ex. YAML)?

@victordidenko
Copy link

This (most popular) extension to use Prettier in VSCode uses bundled Prettier if there is no prettier dependency in the project.
And starting version 4.0.0 it uses Prettier 2.
So in order to have this extension works correctly with xoprettier have to be as dependency inside package.json.

@flo-sch
Copy link

flo-sch commented Apr 7, 2020

@pvdlg is it in the plans to migrate?

Is there anything we can do to help?

@pvdlg
Copy link
Contributor

pvdlg commented Apr 7, 2020

I intend to work on the migration but not sure how much work there is and when I'll have time.
Might take a week or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@sindresorhus @flo-sch @pvdlg @jonahsnider @victordidenko and others