How do you enable emmet for nextjs ( js file)?
Asked
Active
Viewed 3,733 times
2 Answers
18
Emmets don't work in JS files. However, you can set it so that VS Code thinks that it's a JSX file and it would give React IntelliSense.
- Click the button written "JavaScript" in the Status Bar, which should be at the bottom.
- Type "React" and select
react (javascriptreact)
.
- After that, the file is set as a React file, and therefore, you can now use Emmets.
If you want all of your JS files to be set as React files, create .vscode/settings.json
and paste this:
{
"files.associations": {
"*.js": "javascriptreact"
}
}

I.M. Adil
- 414
- 4
- 9
0
You can change the file extension from '.js' to '.jsx'

Ricardo Corrales
- 1
- 1
-
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 19 '22 at 18:56