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

Add Prettier VSCode extension #192

Merged
merged 5 commits into from
Nov 18, 2021
Merged

Add Prettier VSCode extension #192

merged 5 commits into from
Nov 18, 2021

Conversation

machikoyasuda
Copy link
Member

@machikoyasuda machikoyasuda commented Nov 18, 2021

What this PR does

  • Add the Prettier VS Code extension
  • Set the Prettier extension to format on save for CSS, JS (.js, .json), but not HTML

How to test this PR

  • Run this container
  • Save a JS (.js, .json) file and make sure it gets formatted (Example: Use single quotes instead of double quotes on a file and make sure it does get saved)
  • Save a HTML file and make sure it does not get formatted (Example: Save the alert-bar.html file and make sure it does not get reformatted)
  • Save a CSS file and make sure it does get formatted (Example: Put h1, h2 on one line, and Prettier should put them on 2 separate lines)
  • Test a Python file and make sure it does get properly formatted

@machikoyasuda machikoyasuda changed the title Chore/add prettier vscode Add Prettier VSCode extension Nov 18, 2021
@machikoyasuda machikoyasuda marked this pull request as ready for review November 18, 2021 00:21
@machikoyasuda machikoyasuda added this to the November 2021 milestone Nov 18, 2021
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't work on JSON files for me without this here:

"[json]": {
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode"
},

Does it work for you with just the [javascript] entry?

Is there a way to specify multiple languages so we don't have to repeat the same settings for [css] etc.?

Copy link
Member Author

Choose a reason for hiding this comment

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

On the 2nd note, I tried

  "[css, javascript, json, html]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },

but it doesn't work

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

yesterday

Copy link
Member Author

Choose a reason for hiding this comment

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

Dangggg!

Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

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

Good enough for now, we'll adjust as soon as that feature lands in the next VS Code release.

@machikoyasuda machikoyasuda merged commit b74c17e into dev Nov 18, 2021
@machikoyasuda machikoyasuda deleted the chore/add-prettier-vscode branch November 18, 2021 20:27
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