sindresorhus / gulp-jsvalidate Goto Github PK
View Code? Open in Web Editor NEWValidate JavaScript code and report possible syntax errors
License: MIT License
Validate JavaScript code and report possible syntax errors
License: MIT License
Great plugin overall! I like that the line number from the invalid file is listed in the error.
However, is there anyway to also show the path and or name of the file that the validation failed on?
I've tried to do that:
module.exports = function() {
return require('gulp').src( files )
.pipe( require('gulp-jsvalidate')() )
.pipe( require('gulp-jscs')() )
.pipe( jshint('.jshintrc') )
.pipe( jshint.reporter('jshint-stylish')
}
but if jsvalidate finds an error, it breaks everything.
I was able to do that though:
module.exports = function() {
return require('gulp').src( files )
.pipe( require('gulp-jscs')() )
.pipe( jshint('.jshintrc') )
.pipe( jshint.reporter('jshint-stylish')
}
And this is what I do now:
var files = ['app.js', 'lib.js']
module.exports = {
jsvalidate: function() {
return require('gulp').src( files )
.pipe( require('gulp-jsvalidate')() )
},
jscs: function() {
return require('gulp').src( files )
.pipe( require('gulp-jscs')() )
},
jshint: function() {
var jshint = require('gulp-jshint')
return require('gulp').src( files )
.pipe( jshint('.jshintrc') )
.pipe( jshint.reporter('jshint-stylish') )
}
}
with
gulp.task('jshint', require(path + 'validate').jshint)
gulp.task('jsvalidate', require(path + 'validate').jsvalidate)
gulp.task('jscs', require(path + 'validate').jscs)
gulp.task('validate', ['jsvalidate', 'jshint', 'jscs'])
Any idea how to make my first try work?
https://github.com/facebook/esprima/issues/111
This plugin doesn't support es6 features. I think because of facebook is gonna deprecate esprima.
I was trying to use gulp-jsvalidate to find errors in my js files. Although, I found that when I use @import statements, it recognize that statement as error.
As soon as I comment out that statement it works fine.
May be I don't know some settings.
Can you please help me out on this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.