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

chore(prettier): Take Prettier 2.4.0's jsxBracketSameLine → bracketSameLine #749

Merged
merged 1 commit into from
May 15, 2022

Conversation

chrisbobbe
Copy link
Contributor

prettier/prettier@4992d9720, released in 2.4.0, deprecated the
jsxBracketSameLine option in favor of a new, more generic option,
bracketSameLine. See docs:
https://prettier.io/docs/en/options.html#bracket-line

This has caused a warning

jsxBracketSameLine is deprecated.

for people using Prettier 2.4.0+, if their ESLint config leads us to
infer and use a value for jsxBracketSameLine.

So, instead of inferring and using a value for jsxBracketSameLine,
do so for the new bracketSameLine.

In d8bf1e3, which we released in 14.0.0, we stopped supporting
Prettier versions older than 2.5.1. That means we don't need to
maintain backward-compatible code for users with Prettier <2.4.0,
which doesn't have bracketSameLine.

See discussion:
prettier/prettier-eslint-cli#430 (comment)

…meLine

prettier/prettier@4992d9720, released in 2.4.0, deprecated the
`jsxBracketSameLine` option in favor of a new, more generic option,
`bracketSameLine`. See docs:
  https://prettier.io/docs/en/options.html#bracket-line

This has caused a warning

  jsxBracketSameLine is deprecated.

for people using Prettier 2.4.0+, if their ESLint config leads us to
infer and use a value for jsxBracketSameLine.

So, instead of inferring and using a value for jsxBracketSameLine,
do so for the new bracketSameLine.

In d8bf1e3, which we released in 14.0.0, we stopped supporting
Prettier versions older than 2.5.1. That means we don't need to
maintain backward-compatible code for users with Prettier <2.4.0,
which doesn't have bracketSameLine.

See discussion:
  prettier/prettier-eslint-cli#430 (comment)
@idahogurl
Copy link
Collaborator

idahogurl commented May 14, 2022

LGTM. Let's put this as a breaking change, the need for Prettier 2.4+. If that's the case, we have to bump the package to 15.0.0. Whoever squashes and merges this, make sure to follow the conventional commit and put the breaking change in the message box as shown in the first example here: https://www.conventionalcommits.org/en/v1.0.0-beta.2/#examples

@kylemh
Copy link
Collaborator

kylemh commented May 14, 2022

i'll do this tn

ehhhh tomorrow

@kylemh kylemh merged commit 26a574c into prettier:master May 15, 2022
@kylemh
Copy link
Collaborator

kylemh commented May 15, 2022

Screen Shot 2022-05-15 at 11 32 25 AM

@github-actions
Copy link
Contributor

🎉 This PR is included in version 15.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@chrisbobbe chrisbobbe deleted the pr-bracket-same-line branch May 16, 2022 20:40
@chrisbobbe
Copy link
Contributor Author

Thanks for the review, both of you! 🙂

chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request May 26, 2022
TODO: find out what we actually want :) and finish commit message

Following the eagerly awaited resolution of
  prettier/prettier-eslint-cli#304

- add some @babel/ deps for peer-dep requirements

- resolutions line to get
  prettier/prettier-eslint#749

Fixes: zulip#4254
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 2, 2022
Following the eagerly awaited resolution of
  prettier/prettier-eslint-cli#304
.

And adjust our ESLint config so that we can do this with no new
ESLint errors or suppressions. After this, we'll un-ignore the rules
under "New rules we want", one by one, which will mean fixing the
code that doesn't yet follow each rule.

Greg says, about the formatting changes:
  zulip#5393 (review)

> The formatting changes from the Prettier upgrade look fine. Some
> code gets nicer (like `foo.bar().baz()` going on one line), some
> gets less nice (like a lot of stuff getting an extra level of
> indentation). I'm not sure I like it better on net; but Prettier
> is designed as a take-it-or-leave-it package, and I don't have a
> better alternative nor want to be stuck on an old version. So
> 🤷

The added @babel/* deps are to satisfy peer-dependency requirements.

The resolutions line gets us
  prettier/prettier-eslint#749
and can be removed when prettier-eslint-cli bumps its
prettier-eslint version.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 2, 2022
Following the eagerly awaited resolution of
  prettier/prettier-eslint-cli#304
.

And adjust our ESLint config so that we can do this with no new
ESLint errors or suppressions. After this, we'll un-ignore the rules
under "New rules we want", one by one, which will mean fixing the
code that doesn't yet follow each rule.

Greg says, about the formatting changes:
  zulip#5393 (review)

> The formatting changes from the Prettier upgrade look fine. Some
> code gets nicer (like `foo.bar().baz()` going on one line), some
> gets less nice (like a lot of stuff getting an extra level of
> indentation). I'm not sure I like it better on net; but Prettier
> is designed as a take-it-or-leave-it package, and I don't have a
> better alternative nor want to be stuck on an old version. So
> 🤷

The added @babel/* deps are to satisfy peer-dependency requirements.

The resolutions line gets us
  prettier/prettier-eslint#749
and can be removed when prettier-eslint-cli bumps its
prettier-eslint version.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 3, 2022
Following the eagerly awaited resolution of
  prettier/prettier-eslint-cli#304
.

And adjust our ESLint config so that we can do this with no new
ESLint errors or suppressions. After this, we'll un-ignore the rules
under "New rules we want", one by one, which will mean fixing the
code that doesn't yet follow each rule.

Greg says, about the formatting changes:
  zulip#5393 (review)

> The formatting changes from the Prettier upgrade look fine. Some
> code gets nicer (like `foo.bar().baz()` going on one line), some
> gets less nice (like a lot of stuff getting an extra level of
> indentation). I'm not sure I like it better on net; but Prettier
> is designed as a take-it-or-leave-it package, and I don't have a
> better alternative nor want to be stuck on an old version. So
> 🤷

The added @babel/* deps are to satisfy peer-dependency requirements.

The resolutions line gets us
  prettier/prettier-eslint#749
and can be removed when prettier-eslint-cli bumps its
prettier-eslint version.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 8, 2022
Following the eagerly awaited resolution of
  prettier/prettier-eslint-cli#304
.

And adjust our ESLint config so that we can do this with no new
ESLint errors or suppressions. After this, we'll un-ignore the rules
under "New rules we want", one by one, which will mean fixing the
code that doesn't yet follow each rule.

Greg says, about the formatting changes:
  zulip#5393 (review)

> The formatting changes from the Prettier upgrade look fine. Some
> code gets nicer (like `foo.bar().baz()` going on one line), some
> gets less nice (like a lot of stuff getting an extra level of
> indentation). I'm not sure I like it better on net; but Prettier
> is designed as a take-it-or-leave-it package, and I don't have a
> better alternative nor want to be stuck on an old version. So
> 🤷

The added @babel/* deps are to satisfy peer-dependency requirements.

The resolutions line gets us
  prettier/prettier-eslint#749
and can be removed when prettier-eslint-cli bumps its
prettier-eslint version.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 9, 2022
Following the eagerly awaited resolution of
  prettier/prettier-eslint-cli#304
.

And adjust our ESLint config so that we can do this with no new
ESLint errors or suppressions. After this, we'll un-ignore the rules
under "New rules we want", one by one, which will mean fixing the
code that doesn't yet follow each rule.

Greg says, about the formatting changes:
  zulip#5393 (review)

> The formatting changes from the Prettier upgrade look fine. Some
> code gets nicer (like `foo.bar().baz()` going on one line), some
> gets less nice (like a lot of stuff getting an extra level of
> indentation). I'm not sure I like it better on net; but Prettier
> is designed as a take-it-or-leave-it package, and I don't have a
> better alternative nor want to be stuck on an old version. So
> 🤷

The added @babel/* deps are to satisfy peer-dependency requirements.

The resolutions line gets us
  prettier/prettier-eslint#749
and can be removed when prettier-eslint-cli bumps its
prettier-eslint version.
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 9, 2022
Following the eagerly awaited resolution of
  prettier/prettier-eslint-cli#304
.

And adjust our ESLint config so that we can do this with no new
ESLint errors or suppressions. After this, we'll un-ignore the rules
under "New rules we want", one by one, which will mean fixing the
code that doesn't yet follow each rule.

Greg says, about the formatting changes:
  zulip#5393 (review)

> The formatting changes from the Prettier upgrade look fine. Some
> code gets nicer (like `foo.bar().baz()` going on one line), some
> gets less nice (like a lot of stuff getting an extra level of
> indentation). I'm not sure I like it better on net; but Prettier
> is designed as a take-it-or-leave-it package, and I don't have a
> better alternative nor want to be stuck on an old version. So
> 🤷

The added @babel/* deps are to satisfy peer-dependency requirements.

The resolutions line gets us
  prettier/prettier-eslint#749
and can be removed when prettier-eslint-cli bumps its
prettier-eslint version.

And run

  $ tools/tsflower unpack
  $ tools/tsflower pack

to update TsFlower's output for the new Prettier version and rebase
the patches atop that. I see some churn in the patches where it
looks like a Git version is printed at the bottom, and mine differs
from Greg's, hmm.
gnprice pushed a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 9, 2022
Following the eagerly awaited resolution of
  prettier/prettier-eslint-cli#304
.

And adjust our ESLint config so that we can do this with no new
ESLint errors or suppressions. After this, we'll un-ignore the rules
under "New rules we want", one by one, which will mean fixing the
code that doesn't yet follow each rule.

Greg says, about the formatting changes:
  zulip#5393 (review)

> The formatting changes from the Prettier upgrade look fine. Some
> code gets nicer (like `foo.bar().baz()` going on one line), some
> gets less nice (like a lot of stuff getting an extra level of
> indentation). I'm not sure I like it better on net; but Prettier
> is designed as a take-it-or-leave-it package, and I don't have a
> better alternative nor want to be stuck on an old version. So
> 🤷

The added @babel/* deps are to satisfy peer-dependency requirements.

The resolutions line gets us
  prettier/prettier-eslint#749
and can be removed when prettier-eslint-cli bumps its
prettier-eslint version.

And run

  $ tools/tsflower unpack
  $ tools/tsflower pack

to update TsFlower's output for the new Prettier version and rebase
the patches atop that. I see some churn in the patches where it
looks like a Git version is printed at the bottom, and mine differs
from Greg's, hmm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants