Reputation: 17
I installed ESLint globally, using: npm i -g eslint
I initialized ESLint using eslint --init
(when I trying to install eslint locally and running
./node_modules/bin/eslint --init
, it says that didn't have that command)
When I run this command: eslint ./js/lesson_1.js
, all works
When I run this command: eslint --fix ./js/lesson_1.js
, eslint didn't fix my file.
What have I done wrong?
(sorry for my English _)
Upvotes: 0
Views: 472
Reputation: 18264
Is running the command using npx
fine for you?
npx eslint --fix .
Upvotes: -1
Reputation: 24
I'm on a Vue2 + Nuxt project
In order to make use of prettier + eslint the correct way, do the following:
First, install prettier:
npm install --global prettier
Secondly, install eslint/prettier integration:
npm install --save-dev eslint-plugin-prettier eslint-config-prettier
Thirdly, make sure you add the settings to .eslintrc.js
...
extends: [
"@nuxtjs",
"plugin:nuxt/recommended",
"plugin:prettier/recommended",
"eslint:recommended",
],
...
At last, add the desired configuration in the file .prettiercr
{
"semi": false,
"singleQuote": false
}
Now you can run the following command to fix the entire project issues: (don't forget the dot at the end)
eslint --fix .
Upvotes: 0