Check jshint errors before npm run build

Swapnil Patil

I have setup webpack using npm. I installed jshint using npm install jshint --save-dev.

Now if I run command jshint assets/js/index.js i get errors.

I want to check the errors on npm run build

Nikolai Borisik

You can change your build script in the package.json in the way to run lint and then if it successful run build. See example

{
...
  "scripts": {
    "build": "npm run lint && your_build_command",
    "lint": "jshint assets/js/index.js"
   }
...
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

`npm run jshint` results in `missing script: jshint`

Vue.js unexpected token in browser but npm run build with no errors

ReactJS npm run build throws elifecycle & export errors (weird)

I did npm run build and got a lot of ERRORS

Npm run build/deploy does not works and throw "failed to compile errors"

npm run build is throwing errors in my vue cli project but npm run dev works fine

I get a buch of errors when i try to run the npm run build command

NPM run build error

Is there any way to enforce checking dependency version before npm build/yarn run build?

How to run `npm run build`

The difference ”npm r build“ and “npm run build”?

In laravel npm run dev errors:

npm run build fails with "Error: custom keyword definition is invalid: data.errors should be boolean"

npm run build is giving me errors I'm not sure how to fix

Running npm build before/after npm install

Migrated application to Angular 6 : But getting errors while running npm run build --prod. But command npm run build --env=prod runs successfully

How do I run a specific NPM command before build in ASP.NET Core?

npm run build error when running "npm run build"

npm run build and if success then commit

CLion: run tests before build

NextJS - Error make build "npm run build"

TypeError trying to run npm run build

Act on errors in NPM commands run from PowerShell

NextJS type errors not showing with npm run dev

Angularjs $routeProvider jshint errors

Different svelte variable value for npm run dev and npm run build

Running npm script in Dockerfile before dotnet build

How to remove folder with npm before build

Set env varibale before run npm command