# VS Code Extensions recommendations?

**URL:** https://meta.discourse.org/t/vs-code-extensions-recommendations/184456
**Category:** Development
**Created:** [March 25, 2021, 9:30pm UTC](https://meta.discourse.org/t/vs-code-extensions-recommendations/184456 "2021-03-25T21:30:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 25, 2021, 9:30pm UTC](https://meta.discourse.org/t/vs-code-extensions-recommendations/184456/1 "2021-03-25T21:30:18Z")

</div>

I’m an aged use of Emacs. I’ve been trying VS Code for a while. (Surprise–it’s no easier to configure this infinitely extensible editor than it was emacs. I’ve not given up, and it’s really good for a few things, but I’m not even as much of a convert as I’d have hoped).

So, does someone have a configuration that makes Rubocop, eslint, and prettier happy? It’s maddening to not be able to see that stuff until Travis complains and then copy-paste those commands (which should be in bash history by now) to figure out if stuff is wrong.

Can’t I just make it format stuff on save, and warn loudly if it’s not auto-correctable?L

If someone has this working in a way that’s beautiful, I’d love to know what set of plugins you’re using.

But maybe I’ll go see about getting emacs to do this and the couple things I really like (the best so far being shift-control-f to grep a whole sub-directory tree.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [March 25, 2021, 9:44pm UTC](https://meta.discourse.org/t/vs-code-extensions-recommendations/184456/2 "2021-03-25T21:44:01Z")

</div>

I think there are a few of us at CDCK that use VSCode for everything. For linting/formatting, I have:

- [ESLint plugin](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Prettier plugin](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
- [Ruby plugin](https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby)

And the relevant settings:

```json
{
    "editor.tabSize": 2,
    "[javascript]": {
        "editor.formatOnSave": true
        "editor.defaultFormatter": "esbenp.prettier-vscode",
    },
    "[scss]": {
        "editor.formatOnSave": true,
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[ruby]": {
        "editor.formatOnSave": true,
    },
    "ruby.useBundler": true,
    "ruby.format": "rubocop",
    "ruby.lint": {
        "rubocop": {
            "useBundler": true,
        }
    },
    "editor.formatOnSaveTimeout": 10000,
    "eslint.format.enable": true,
    "javascript.validate.enable": false,
}

```

> [@pfaffman](#):
>
> It’s maddening to not be able to see that stuff until Travis complains

Yeah for sure! For discourse core, we have a [lefthook configuration](https://github.com/discourse/discourse/blob/master/lefthook.yml) to try and save some of that pain. If the on-save editor integration isn’t enough, you could certainly do a similar thing in your plugins.

I’d also highly recommend installing the ‘GitLens’ plugin for VSCode. It can give you useful blame annotations while you’re working:

 ![Screenshot 2021-03-25 at 21.43.11](https://global.discourse-cdn.com/meta/original/3X/0/6/066aa3062d1c55d28918f9cfba843dcfd39eb3ae.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 25, 2021, 10:04pm UTC](https://meta.discourse.org/t/vs-code-extensions-recommendations/184456/3 "2021-03-25T22:04:33Z")

</div>

I haven’t done it yet, but I wanted to say now a big thanks! And maybe your settings will be the juice I’m missing once I figure out where to stick that.

Can you say more about how to make that left hook do something?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [March 25, 2021, 10:07pm UTC](https://meta.discourse.org/t/vs-code-extensions-recommendations/184456/4 "2021-03-25T22:07:23Z")

</div>

> [@pfaffman](#):
>
> Can you say more about how to make that left hook do something?

I _think_ you just need to `cd` to your discourse directory, run `yarn install` (which you may have already done), and then `lefthook install`

Then, every time you try to `git commit` it will run the linters on the changed files, and warn you of any issues.
