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

@wordpress/prettier-config 's jsxBracketSameLine config is now deprecated #37516

Closed
waviaei opened this issue Dec 20, 2021 · 2 comments · Fixed by #40479
Closed

@wordpress/prettier-config 's jsxBracketSameLine config is now deprecated #37516

waviaei opened this issue Dec 20, 2021 · 2 comments · Fixed by #40479
Labels
[Package] Prettier config /packages/prettier-config [Type] Enhancement A suggestion for improvement.
Projects

Comments

@waviaei
Copy link
Contributor

waviaei commented Dec 20, 2021

Description

When setting up our project's esllint using @wordpress/eslint-plugin, specified in .eslintrc as per:
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],

I get this error notice jsxBracketSameLine is deprecated.

I found that this error notice is Prettier related, and comes from this line in @wordpress/prettier-config

This change is from Prettier 2.4
https://prettier.io/blog/2021/09/09/2.4.0.html

This release renames the jsxBracketSameLine option to bracketSameLine, which supports HTML, Vue, and Angular in addition to JSX. The old name has been deprecated.

@wordpress/prettier-config's config setting needs to be updated

Step-by-step reproduction instructions

Here, we are using @wordpress/eslint-plugin as standalone -- not as part of @wordpress/scripts

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@gziolo
Copy link
Member

gziolo commented Dec 23, 2021

I opened #37607 to start making the official proposal to switch to the original Prettier in the most recent 2.5 version. Otherwise, we can't apply the changes proposed because we use a fork that is pinned to Prettier 2.2. I included the fix in #37607.

@waviaei
Copy link
Contributor Author

waviaei commented Dec 28, 2021

@gziolo Thanks for the explanation. That explains why seeing the error when @wordpress/eslint-plugin is used separately from @wordpress/scripts. And yes, I agree, I think it will be better going forward, to move back to using the original Prettier .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Prettier config /packages/prettier-config [Type] Enhancement A suggestion for improvement.
2 participants