close

How to run eslint –fix from npm script

Hello Guys, How are you all? Hope You all Are Fine. Today we are going to learn How to run eslint –fix from npm script in javascript. So Here I am Explain to you all the possible methods here.

Without wasting your time, Let’s start This Article.

How to run eslint –fix from npm script ?

  1. How to run eslint –fix from npm script ?

    to run eslint –fix from npm script You can add a new command in package.json.
    "scripts": { "lint": "eslint --fix --ext .js,.jsx ." }
    And then you can run it in terminal npm run lint.

  2. How to run eslint –fix from npm script ?

    to run eslint –fix from npm script You can add a new command in package.json.
    "scripts": { "lint": "eslint --fix --ext .js,.jsx ." }
    And then you can run it in terminal npm run lint.

Method 1

You can run below command:

npm run lint -- --fix

Method 2

You can add a new command in package.json.

"scripts": {
    "lint": "eslint --fix --ext .js,.jsx ."
}

And then you can run it in terminal npm run lint.

Summery

It’s all About this article. Hope all method helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which method worked for you? Thank You.

Leave a Comment