Skip to content

ASAP-290 Fix prettier version#4118

Merged
gabiayako merged 12 commits intomasterfrom
prettier-test
Jan 15, 2024
Merged

ASAP-290 Fix prettier version#4118
gabiayako merged 12 commits intomasterfrom
prettier-test

Conversation

@gabiayako
Copy link
Copy Markdown
Contributor

@gabiayako gabiayako commented Jan 11, 2024

Updating prettier version to the last version available so it uses the fix below introduced in 3.0.3 release: //github.com/prettier/prettier/blob/main/CHANGELOG.md#303

Prettier v3 uses dynamic imports, user yarnpkg/berry#5411 (comment) when Yarn's PnP mode is enabled, add preferUnplugged: true to package.json, so Yarn will install Prettier as unplug by default.

Also @typescript-eslint/eslint-plugin and @typescript-eslint/parser were updated accordingly to this PR https://github.com/yldio/asap-hub/pull/4047/files


Note: It's necessary to reload window after changing to this branch to see it working as the video below

Screen.Recording.2024-01-10.at.10.23.48.mov

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8117968) 99.40% compared to head (59e4f0f) 99.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4118      +/-   ##
==========================================
+ Coverage   99.40%   99.41%   +0.01%     
==========================================
  Files         947      947              
  Lines       16632    16632              
  Branches     5135     5135              
==========================================
+ Hits        16533    16535       +2     
+ Misses         99       97       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

steps:
- name: Checkout
uses: actions/checkout@v3
- run: yarn cache clean
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without cache clean + install I was getting this Error: Required unplugged package missing from disk error. I couldn't find a better way to fix it, please if any of you have suggestions to make it better I would appreciate it a lot.

Screenshot 2024-01-12 at 07 57 50

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the reason you are having this issue is because you unplugged a couple of packages - that means you told yarn to not store them as zips inside .yarn/cache but rather unpack it and store in .yarn/unplugged and that folder (as opposed to the cache one) is not checked into git meaning that we have to do yarn install do get the contents of those unplugged packages.

The way we go about those packages is that we run yarn install once and then cache it and then we use this step

       - name: Cache build typecheck output
        uses: ./.github/actions/cache-unplugged
        with:
          environment-name: ${{ inputs.environment-name }}

to load this cache into your current job. So just try and add this instead of cache clean and install.

Would be keen to understand why you had to unplug those packages?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what is written in prettier changelog I understood version 3 needs to be unplugged. Here in the description of this PR I've left the link to the changelog #4118 (comment)

allowSignup
onClick={() =>
// Effect should populate this ref before a click can occur
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find in the changelog but I believe this @typescript-eslint/no-non-null-assertion and @typescript-eslint/no-empty-function was changed in one of the versions in between the one we had and the last one because now we get this Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-non-null-assertion') and Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-empty-function') in several files

Screenshot 2024-01-12 at 07 58 12

steps:
- name: Checkout
uses: actions/checkout@v3
- run: yarn cache clean
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the reason you are having this issue is because you unplugged a couple of packages - that means you told yarn to not store them as zips inside .yarn/cache but rather unpack it and store in .yarn/unplugged and that folder (as opposed to the cache one) is not checked into git meaning that we have to do yarn install do get the contents of those unplugged packages.

The way we go about those packages is that we run yarn install once and then cache it and then we use this step

       - name: Cache build typecheck output
        uses: ./.github/actions/cache-unplugged
        with:
          environment-name: ${{ inputs.environment-name }}

to load this cache into your current job. So just try and add this instead of cache clean and install.

Would be keen to understand why you had to unplug those packages?

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity - why do we no longer need these? are non-null assertions now allowed?

Comment thread package.json Outdated
"unplugged": true
},
"@typescript-eslint/parser@6.18.1": {
"unplugged": true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any particular reason why you need to unplug this and the one above?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants