Skip to content

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

Closed

Description

@waviaei

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

Activity

  1. added
    [Tool] Prettier config
    [Type] Enhancement
    on Dec 20, 2021
  2. gziolo commented on Dec 23, 2021

    @gziolo
    Member

    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.

  3. waviaei commented on Dec 28, 2021

    @waviaei
    ContributorAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Tool] Prettier config[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions