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

Update dev dependency "prettier" #9329

Closed
mikeharder opened this issue Jun 5, 2020 · 9 comments
Closed

Update dev dependency "prettier" #9329

mikeharder opened this issue Jun 5, 2020 · 9 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system.

Comments

@mikeharder
Copy link
Member

Overview

I tried updating to prettier@^2.0.5 (draft PR #9325), but when I execute npm run format, there are a ton of formatting changes. Examples include:

In order to upgrade, I think we will need to either modify our config to make prettier@2 work more closely to prettier@1, or we will need to reformat nearly all our source files.

Breaking Changes

https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes

Relevant breaking changes:

  • Drop support for Node versions older than 10
    • Probably OK since we only build on Node 10 and above. Node 8 is only used for testing.
  • Change default value for trailingComma to es5
  • Change default value for arrowParens to always
    • Already set to this value in our config
  • Change default value for endOfLine to lf
    • Already set to this value in our config
@mikeharder mikeharder added EngSys This issue is impacting the engineering system. Client This issue points to a problem in the data-plane of the library. labels Jun 5, 2020
@mikeharder mikeharder removed the EngSys This issue is impacting the engineering system. label Jun 5, 2020
@ramya-rao-a ramya-rao-a added this to the Backlog milestone Jun 9, 2020
@willmtemple
Copy link
Contributor

@mikeharder It looks like this upgrade is required to support import type statements (and any other new additional syntax that shows up, I imagine). This seems more important now, given that we are running prettier on all of our staged files for commit, so if I use something that has import type, I'm now seeing the commit hook fail.

CC @xirzec @ramya-rao-a @deyaaeldeen

Don't want to speak for everyone, but personally I'm okay with reformatting our source files to take the upgrade to prettier 2.

@xirzec
Copy link
Member

xirzec commented Sep 15, 2020

I also would like to move to prettier2. I don't mind trailingComma being es5, I think it's easier on diffs.

@witemple-msft
Copy link
Member

Note this is also blocking usage of ES private fields: #15826 (comment)

@ramya-rao-a
Copy link
Contributor

Drop support for Node versions older than 10

We dropped support for Node.js 10 this month, so we are good to go here

@JonathanCrd
Copy link
Member

Hi, to confirm, we are fine with reformatting our code to prettier 2?

I am considering the option of splitting this task into 2 or more PRs, one for updating the dependency version in the package.json files, and another one just for the output of npm run format in all the packages, since there will be tons of modified files. I'm curious about what you think about this.

@deyaaeldeen
Copy link
Member

@JonathanCrd yes we're would like to reformat, but I guess we will need to agree on which configuration to use. We use these configs currently but v2 changes some defaults which affects the behavior of the configs not listed in our config file.

@maorleger
Copy link
Member

Hi, to confirm, we are fine with reformatting our code to prettier 2?

I am considering the option of splitting this task into 2 or more PRs, one for updating the dependency version in the package.json files, and another one just for the output of npm run format in all the packages, since there will be tons of modified files. I'm curious about what you think about this.

Would that cause your first PR to fail because the check:format command will start failing?

Vote YES for trailing commas this November! 😄

@JonathanCrd
Copy link
Member

Would that cause your first PR to fail because the check:format command will start failing?

@maorleger I didn't consider that, thanks for pointing it out. I'm going to open a draft pr to test it.

JonathanCrd added a commit that referenced this issue Jan 5, 2022
Solves: #9329 for packages under `sdk/eventgrid/`.
 
Updated `prettier` dev-dependency version to latest `2.5.1`.
Files were re-formatted as well. There are only format changes in this PR, no manual changes except for package.json files.
 
Main format changes with Prettier 2.x in this PR include:
- Trailing commas by default.
- Whitespace added after every `function` keyword.
@JonathanCrd
Copy link
Member

All "prettier" dependencies in the repo have been upgraded to Prettier 2 (^2.5.1)

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system.
Projects
None yet
Development

No branches or pull requests

10 participants