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

Pre-install Prettier and ESLint VSCode extensions #9269

Merged
merged 1 commit into from
Apr 28, 2022

Conversation

trumbitta
Copy link
Contributor

Description

In an effort to further simplify #8995, this only adds pre-installed and pre-activated ESLint & Prettier extensions for VSCode with "format on save".

It's a cherry-pick from #8895 so it's expected to vanish from that PR once this gets merged.

Related Issue(s)

Re #3841
This is a prerequisite to ensure the work on the linting issues can proceed with sane defaults.

How to test

For Prettier: open a TS file, and see if the code you write gets formatted on save.
For ESLint: open a TS file, produce a linting error, and see if VSCode marks it with a squiggly yellow line.

Release Notes

- [devx]: Added ESLint and Prettier to the auto-installed VSCode extensions
- [devx]: Activated "format on save" for TypeScript and JavaScript

Documentation

@trumbitta
Copy link
Contributor Author

/cc @jankeromnes @filiptronicek @iQQBot

@trumbitta
Copy link
Contributor Author

trumbitta commented Apr 20, 2022

ping @jankeromnes @filiptronicek 😊

@iQQBot
Copy link
Contributor

iQQBot commented Apr 20, 2022

Thanks for your contribution @trumbitta

It's looks good to me, but I will ping @gitpod-io/engineering-webapp have a look

@iQQBot
Copy link
Contributor

iQQBot commented Apr 20, 2022

/werft run no-preview

👍 started the job as gitpod-build-prettier-eslint-fork.0

@iQQBot
Copy link
Contributor

iQQBot commented Apr 20, 2022

image
Unfortunately we have some components besides the dashboard and server that are written in typescript, but may not follow the specification, which will result in a lot of changes once saved

This would put a lot of pressure on the review, so maybe we need to format all items or exclude them before merging this PR

@trumbitta
Copy link
Contributor Author

trumbitta commented Apr 20, 2022

image Unfortunately we have some components besides the dashboard and server that are written in typescript, but may not follow the specification, which will result in a lot of changes once saved

This would put a lot of pressure on the review, so maybe we need to format all items or exclude them before merging this PR

Thanks for reviving this PR :)

I had anticipated this the first time and the second time I worked on the general "unified code style" problem.

Then @easyCZ took over a part of it and also added a pre-commit hook which, I guess, already addresses your concerns if finally applied to everything?

This PR is a fundamental pre-requisite for #3841 🙏

@geropl geropl added the team: webapp Issue belongs to the WebApp team label Apr 21, 2022
@laushinka
Copy link
Contributor

Oh my, I'm sorry this was missed this long. Taking a look!

@laushinka
Copy link
Contributor

I tried editing something in a .tsx file and the code didn't get prettified on save. @iQQBot it worked for you?

@trumbitta
Copy link
Contributor Author

trumbitta commented Apr 28, 2022

I tried editing something in a .tsx file and the code didn't get prettified on save. @iQQBot it worked for you?

🤔 could it be that the file had syntax errors? Prettier only activates when the file is completely sane 🤔

@trumbitta
Copy link
Contributor Author

Screen.Recording.2022-04-28.at.14.54.43.mov

It's working for me!
Did the auto-install of the Prettier extension work for you? I know I also have it installed globally for my VSCode account so if something's amiss with the installation it's entirely possible I wouldn't notice.

image

@laushinka
Copy link
Contributor

It's working for me! Did the auto-install of the Prettier extension work for you? I know I also have it installed globally for my VSCode account so if something's amiss with the installation it's entirely possible I wouldn't notice.

Yup! I also only changed some formatting and spacing. Hmm..
Screenshot 2022-04-28 at 15 01 12

@laushinka
Copy link
Contributor

I have been having weird issues with my editor(s), so let me nudge someone else to test it.

@laushinka
Copy link
Contributor

Thank you @andrew-farries for helping testing it and thank you @trumbitta for the contribution! It looks like there are only conflicts that need to be resolved, and then it's good to go.

@trumbitta
Copy link
Contributor Author

trumbitta commented Apr 28, 2022

Thank you @laushinka and @andrew-farries 🙏

I just rebased from main and fixed the conflicts 🤞

@laushinka
Copy link
Contributor

laushinka commented Apr 28, 2022

/werft run no-preview

👍 started the job as gitpod-build-prettier-eslint-fork.1
(with .werft/ from main)

@roboquat roboquat merged commit 96e3b0f into gitpod-io:main Apr 28, 2022
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: accepted ✔️ community-contribution deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants