The extension uses the ESLint library installed in the opened workspace folder. If the folder doesn't provide one the extension looks for a global install version. If you haven't installed ESLint either locally or globally do so by running
npm
install eslint in the workspace folder for a local
install or npm install -g eslint for
a global install.On new folders you might also need to create a
.eslintrc configuration
file. You can do this by either using the VS Code command Create
ESLint configuration or by running the eslint command
in a terminal. If you have installed ESLint globally (see above) then
run eslint
--init in a terminal. If you have installed
ESLint locally then run .\node_modules\.bin\eslint
--init under Windows and ./node_modules/.bin/eslint
--init under Linux and Mac.ir
.eslintrc arba .eslint:
{
"extends": "react-app"
}
Komentarai
Rašyti komentarą