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 minimal vscode settings and extensions #1109

Merged
merged 3 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Github doesn't like it, but VSCode allows JSON with comments, soIwe might as well take advantage.
These comments were autogenerated by vscode, but I find them helpful.

// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"esbenp.prettier-vscode",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're using the ESLint prettier plugin, so we shouldn't need this, we should use the ESLint extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I switched over to the eslint plugin, but I can't get it to actually work as a formatter onSave, despite this setting:

"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,

Do you have it working locally with the eslint plugin?

"editorconfig.editorconfig",
"juanblanco.solidity",
"golang.go",
Comment on lines +9 to +10
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My primary motivation for this PR was to standardize the prettier config. I included these two other extensions which I assume everyone is using for our other primary languages, but we can remove these if anyone objects.

],
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I've never used vscode before, is this the right place to put "files.trimTrailingWhitespace": true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, and I've just added that below.

I feel conflicted about that, because my initial intent with this PR was for the extensions.json file above to encourage people to just add the editorconfig plugin, and then have all whitespace config settings in the .editorconfig file here.

But if adding this one line fixes the biggest whitespace pain point instantly, it seems reasonable to just include.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not super opinionated and never really have messed with .vscode or .editorconfig files

"[typescript]": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can also work for javascript?

"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"prettier.configPath": "./.prettierrc.json",
"prettier.ignorePath": "",
"prettier.prettierPath": "./.node_modules/prettier",
"prettier.useEditorConfig": true,
"editorconfig.generateAuto": false,
}