JavaScript how does the ignore parameter works in gulp and nodemon?

I'm trying to create a gulpfile that lint my personal javascript files (.js) but ignore any vendor/third party libaries.

My gulp file is listed below:

var gulp = require("gulp"),
    uglify = require("gulp-uglify"),
    jshint = require("gulp-jshint"),
    jasmine = require("gulp-jasmine"),
    nodemon = require("gulp-nodemon");


// lint JS files for bad habbits
gulp.task("lint", function () {
    gulp.src(["**/*.js", "node_modules/*"])
        .pipe(jshint())
        .pipe(jshint.reporter("default"));
});


gulp.task("nodemon", function () {
    nodemon({
            script: "server.js", 
            ext: "html css jade js", 
            ignore: ["node_modules/*"]
        })
        .on("change", ["lint"])
        .on("restart", function () {
            console.log("Change detected, restarting server ...");
        });
});

gulp.task("default",["nodemon"]);

When I run the "gulp default" command in my terminal it still lint the javascript files in the node_modules. I've tried variations of the glob syntax but I can't seem to achieve the desired behaviour.

Any idea where I've gone wrong?

Thanks.

Answer:1

The glob pattern you've set, node_modules/* only matches the files in the root of the node_modules directory, but not all the children with an highter depth. You need to set is as node_modules/**/*, this will match everything. I advice you however to only match js files, with node_modules/**/*.js.

You also need to negate the pattern with !, gulp does not know that you want to do that, so it will look like:

gulp.src(['**/*.js', '!node_modules/**/*.js'])

For nodemon, following the same thing you can use the node_modules/**/* pattern.

The library used by gulp for globbing is minimatch.

Answer:2

I am trying to display data from database in angularjs using webservice But geting Error[object Object] while retriving data My web method is: <WebMethod()> _ <ScriptMethod(ResponseFormat:=...

I am trying to display data from database in angularjs using webservice But geting Error[object Object] while retriving data My web method is: <WebMethod()> _ <ScriptMethod(ResponseFormat:=...

  1. display data from another sheet in excel
  2. display data from database in html
  3. display data from mysql in php
  4. display data from database in django
  5. display data from firestore
  6. display data from database in python
  7. display data from csv in html
  8. display data from database in python flask
  9. display data from excel in html
  10. display data from api in html
  11. display data from javascript to html
  12. display data from database in tkinter
  13. display data from database in asp.net c#
  14. display data from database in gridview in mvc
  15. display data from google spreadsheet on website
  16. display data from google sheets on website
  17. display data from database in wordpress page
  18. display data from database
  19. display data from two tables in sql
  20. display data from database in laravel

In an isomorphic application with Reactjs, you need to pass the identical initial state that was rendered on the server down to the client (which will then 'rehydrate' the app with event bindings and ...

In an isomorphic application with Reactjs, you need to pass the identical initial state that was rendered on the server down to the client (which will then 'rehydrate' the app with event bindings and ...

  1. json.stringify window object
  2. pass json object in window.location.href

I have a javascript object and want to use angular's filter on a specific deep property but it does not seem to work. function MyCtrl($scope, $filter) { $scope.items = [ {id:{val:1,str:'abc'}, ...

I have a javascript object and want to use angular's filter on a specific deep property but it does not seem to work. function MyCtrl($scope, $filter) { $scope.items = [ {id:{val:1,str:'abc'}, ...

  1. angularjs filter specific fields
  2. angularjs filter specific property
  3. angularjs filter specific column
  4. angularjs filter by property
  5. angularjs filter by multiple properties
  6. angularjs filter by object property
  7. angularjs filter by date
  8. angularjs filter by
  9. angularjs filter by name
  10. angularjs filter by field
  11. angularjs filter by property value
  12. angularjs filter by function
  13. angularjs filter by array of values
  14. angularjs filter by multiple values
  15. angularjs filter by value
  16. angularjs filter by id
  17. angularjs filter by key
  18. angularjs filter by two properties
  19. angularjs filter by array
  20. angularjs filter by property in controller

I am trying to develope a e-learning site for kids. It contains an excercise to select the right answer among the given four options,by seeing the clue image. When the kid selects the right answer,the ...

I am trying to develope a e-learning site for kids. It contains an excercise to select the right answer among the given four options,by seeing the clue image. When the kid selects the right answer,the ...

  1. javascript validation error message display
  2. javascript validation error
  3. javascript validation error in eclipse
  4. javascript validation error messages
  5. javascript validation error class
  6. javascript throw validation error
  7. javascript add validation error
  8. javascript remove validation error
  9. javascript show validation error
  10. javascript form validation error div
  11. javascript form validation error messages
  12. javascript html validation error
  13. javascript internal validation error
  14. javascript checkbox validation error
  15. javascript validation remove error message
  16. javascript input error validation
  17. javascript focus on validation error
  18. javascript show validation error message
  19. javascript custom validation error message
  20. javascript input validation error message