DEV Community

jastuccio
jastuccio

Posted on

Set file associations per project in VS Code

I am in and out of several different frameworks. When editing in VS Code sometimes I want .js files to be "React JavaScript" instead of just "JavaScript" in a particular project.

Alt Text

You can set the association by creating settings.json in a .vscode directory. This

{
  "files.associations": {
    "*.js": "javascriptreact"
  }
  // other project settings
}
Enter fullscreen mode Exit fullscreen mode

If you need different file associations you should be able to find them by searching: files.associations vscode + the language you need.

Top comments (1)

Collapse
 
jastuccio profile image
jastuccio

Revisited this today to use it in a new project. This is why I started writing posts on dev.to 🙂