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

Dependencies: Bump prettier dependency, cleanup config #19672

Merged
merged 6 commits into from Nov 2, 2022

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Oct 28, 2022

Issue: N/A

I'm doing a little cleanup of linting/prettier, and found a few issues:

  • We had duplicate prettier configs, .prettierrc and prettier.config.js. When running prettier via eslint, it seems that prettier.config.js was being used, but running on the command line (e.g. with yarn lint:other), then .prettierrc was used.
  • in our dependencies for prettier for a few packages, we were pinning to <=2.3.0, due to IE support (Fix prettier transpile problems #17239).
  • @storybook/components was setting prettier as a dev dependency, even though it is used as a direct dependency. This is necessary, for prettier to be pre-bundled.

What I did

  • Removing the rc file exposed that html was not formatting correctly with the babel parser, so I removed the override and yarn lint:other now passes.
  • Since we've dropped IE, I think we can remove the restriction on prettier version, so I did. This has a potential to save a lot of install size, since older versions of prettier are about 20mb on disk (https://packagephobia.com/result?p=prettier).
  • I moved prettier to dependencies of @storybook/components. Reverted this, needs to get pre-bundled.

How to test

CI should pass

Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@IanVS IanVS removed their assignment Oct 31, 2022
@IanVS
Copy link
Member Author

IanVS commented Oct 31, 2022

I reverted the move of prettier from devDeps to deps. It's back to devDependencies. This is ready for review.

@ndelangen ndelangen merged commit b298a49 into next Nov 2, 2022
@ndelangen ndelangen deleted the prettier-upgrade branch November 2, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants