

Install all of your packages as dev dependencies as noted above. You get the idea: yarn add -D eslint-plugin-react eslint-plugin-react-hooks

By itself, Prettier is just a code formatter that enforces certain code style rules people typically use both ESLint and Prettier together, extending ESLint with Prettier’s recommended rules.

You can also optionally install Prettier and its associated ESLint plugins. Since we want to use ESLint to format JavaScript, we’ll need to install the eslint package ( gasp). You can use this shortcut to open the list directly.1. It will pop up the list where you can select the appropriate language.Īs you can see in the Command Palette, there’s a default shortcut to change the language mode. Use the shortcut Ctrl+Shift+P and start typing “Change Language Mode”.

Click on this and select the appropriate language from the list.Īs for every action in VS Code, you can use the Command Palette. Manually change the language modeĪt the bottom right of the editor, you’ll see “Plain Text” written. To add relevant colors, you need to select the correct “language mode”. So it’s just a big lump of text, without any syntax. If everything is grey, chances are your file is highlighted as a “plain text”. This is not about editor theme or something, it’s called the syntax highlighting. This is a legit question you have to face when you start using this editor. Everything looks grey and it seems that VS Code doesn’t “understand” your code. Sometimes you end up here because you copy pasted some code from the Internet. But you don’t have these nice colors that differentiate the variables from the properties, the functions, etc. Maybe it’s CSS, maybe it’s JavaScript, maybe it’s Python. You might be in a situation where you have a text file open in VS Code, but everything is grey.
