mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-25 07:44:33 +03:00
Add gulp task for JavaScript files linting
This commit is contained in:
parent
fcdc1021af
commit
2e629df611
26
src/.eslintrc
Normal file
26
src/.eslintrc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"rules": {
|
||||||
|
"indent": ["error", 4, {"SwitchCase": 1}],
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"semi": ["error", "always"],
|
||||||
|
"guard-for-in": "error"
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"Mibew": true,
|
||||||
|
"MibewAPI": true,
|
||||||
|
"MibewAPIInteraction": true,
|
||||||
|
"MibewAPIChatInteraction": true,
|
||||||
|
"MibewAPIUsersInteraction": true,
|
||||||
|
"MibewAPIExecutionContext": true,
|
||||||
|
"Handlebars": true,
|
||||||
|
"_": true,
|
||||||
|
"Backbone": true,
|
||||||
|
"jQuery": true,
|
||||||
|
"vex": true,
|
||||||
|
"validator": true
|
||||||
|
},
|
||||||
|
"env":{
|
||||||
|
"browser": true
|
||||||
|
}
|
||||||
|
}
|
@ -24,7 +24,8 @@ var fs = require('fs'),
|
|||||||
chmod = require('gulp-chmod'),
|
chmod = require('gulp-chmod'),
|
||||||
xgettext = require('gulp-xgettext'),
|
xgettext = require('gulp-xgettext'),
|
||||||
concatPo = require('gulp-concat-po'),
|
concatPo = require('gulp-concat-po'),
|
||||||
rename = require('gulp-rename');
|
rename = require('gulp-rename'),
|
||||||
|
eslint = require('gulp-eslint');
|
||||||
|
|
||||||
// Set global configs.
|
// Set global configs.
|
||||||
var config = {
|
var config = {
|
||||||
@ -83,6 +84,14 @@ gulp.task('phpcs', ['composer-install-dev'], function() {
|
|||||||
.pipe(phpcs.reporter('fail'));
|
.pipe(phpcs.reporter('fail'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Checks all JavaScript Source files with ESLint.
|
||||||
|
gulp.task('eslint', function() {
|
||||||
|
return gulp.src(config.jsPath + '/source/**/*.js')
|
||||||
|
.pipe(eslint())
|
||||||
|
.pipe(eslint.format())
|
||||||
|
.pipe(eslint.failAfterError());
|
||||||
|
});
|
||||||
|
|
||||||
// Get and install PHP Composer
|
// Get and install PHP Composer
|
||||||
gulp.task('get-composer', function(callback) {
|
gulp.task('get-composer', function(callback) {
|
||||||
// Check if Composer already in place
|
// Check if Composer already in place
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
"lodash": "~3.9.3",
|
"lodash": "~3.9.3",
|
||||||
"strftime": "~0.9.2",
|
"strftime": "~0.9.2",
|
||||||
"del": "~1.2.0",
|
"del": "~1.2.0",
|
||||||
"event-stream": "~3.3.1"
|
"event-stream": "~3.3.1",
|
||||||
|
"eslint": "~2.11.0",
|
||||||
|
"gulp-eslint": "~2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user