Skip to content

Commit

Permalink
Update jshintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Oct 3, 2014
1 parent 26a2a6e commit e247041
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
7 changes: 5 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"-W103": true,
"proto": true,
"eqnull": true,
"expr": true,
"indent": 2
"indent": 2,
"node": true,
"trailing": true,
"quotmark": "single"
}
11 changes: 5 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
mocha = require('gulp-mocha'),
$ = require('gulp-load-plugins')(),
path = require('path');

var lib = 'lib/**/*.js',
test = 'test/scripts/**/*.js';

gulp.task('mocha', function(){
return gulp.src('test/index.js')
.pipe(mocha({
.pipe($.mocha({
reporter: 'spec',
ignoreLeaks: true
}));
});

gulp.task('jshint', function(){
return gulp.src(lib)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.jshint.reporter('fail'));
});

gulp.task('watch', function(){
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/helper/open_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function(options){

description = description.substring(0, 200).replace(/^\s+|\s+$/g, '')
.replace(/\"/g, '\'')
.replace(/\>/g, "&");
.replace(/\>/g, '&');

if (!images.length && content){
var $ = cheerio.load(content);
Expand Down
2 changes: 1 addition & 1 deletion lib/util/escape.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ exports.yaml = require('hexo-front-matter').escape;
*/
exports.regex = function(str){
// http://stackoverflow.com/a/6969486
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
};

var defaultDiacriticsRemovalap = [
Expand Down
4 changes: 2 additions & 2 deletions lib/util/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ var mkdir = exports.mkdir = function(destination, callback){
*/

var writeFile = function(destination, content, callback) {
fs.open(destination, "w", function(err, fd) {
fs.open(destination, 'w', function(err, fd) {
if (err) callback(err);
fs.write(fd, content, 0, "utf8", function(err, written, buffer) {
fs.write(fd, content, 0, 'utf8', function(err, written, buffer) {
callback(err);
});
});
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@
"warehouse": "0.2.2"
},
"devDependencies": {
"mocha": "^1.20.1",
"chai": "^1.9.1",
"gulp": "^3.6.2",
"gulp-jshint": "^1.5.5",
"gulp-load-plugins": "^0.7.0",
"gulp-mocha": "^0.5.1",
"jshint-stylish": "^0.4.0"
"jshint-stylish": "^0.4.0",
"mocha": "^1.20.1"
}
}

0 comments on commit e247041

Please sign in to comment.