forked from rockstor/rockstor-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rockstor#1623 Init commit with eslint and gulp
Signed-off-by: Mirko Arena <mirko.arena@gmail.com>
- Loading branch information
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
test/* | ||
conf/* | ||
src/rockstor/fs/* | ||
src/rockstor/cli/* | ||
src/rockstor/templates/* | ||
src/rockstor/rest_framework_custom/* | ||
src/rockstor/system/* | ||
src/rockstor/scripts/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* | ||
* @licstart The following is the entire license notice for the | ||
* JavaScript code in this page. | ||
* | ||
* Copyright (c) 2012-2017 RockStor, Inc. <http://rockstor.com> | ||
* This file is part of RockStor. | ||
* | ||
* RockStor is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published | ||
* by the Free Software Foundation; either version 2 of the License, | ||
* or (at your option) any later version. | ||
* | ||
* RockStor is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @licend The above is the entire license notice | ||
* for the JavaScript code in this page. | ||
* | ||
* | ||
*/ | ||
|
||
|
||
module.exports = { | ||
'env': { | ||
'browser': true, | ||
'jquery': true, | ||
'es6': true | ||
}, | ||
'extends': 'eslint:recommended', | ||
'rules': { | ||
'strict': 'off', | ||
'no-unused-vars': 'off', | ||
'no-undef': 'off', | ||
'indent': [ | ||
'error', | ||
4 | ||
], | ||
'linebreak-style': [ | ||
'error', | ||
'unix' | ||
], | ||
'quotes': [ | ||
'error', | ||
'single' | ||
], | ||
'semi': [ | ||
'error', | ||
'always' | ||
], | ||
'no-console': [ | ||
'error', | ||
{ | ||
'allow': [ | ||
'log' | ||
] | ||
} | ||
] | ||
}, | ||
'globals': { | ||
// Rockstor jslibs dependencies | ||
'Backbone': false, | ||
'Handlebars': false, | ||
'_': false, | ||
'd3': false, | ||
'humanize': false, | ||
'io': false, | ||
'moment': false, | ||
'Chart': false, | ||
'options': true | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* | ||
* @licstart The following is the entire license notice for the | ||
* JavaScript code in this page. | ||
* | ||
* Copyright (c) 2012-2017 RockStor, Inc. <http://rockstor.com> | ||
* This file is part of RockStor. | ||
* | ||
* RockStor is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published | ||
* by the Free Software Foundation; either version 2 of the License, | ||
* or (at your option) any later version. | ||
* | ||
* RockStor is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @licend The above is the entire license notice | ||
* for the JavaScript code in this page. | ||
* | ||
* | ||
*/ | ||
|
||
var gulp = require('gulp'); | ||
var eslint = require('gulp-eslint'); | ||
|
||
|
||
gulp.task('lint', lintJob); | ||
gulp.task('default', ['lint']); | ||
|
||
function lintJob() { | ||
|
||
var jssrc = 'src/rockstor/storageadmin/static/storageadmin/js/'; | ||
var jsfiles = [ | ||
'license.js', | ||
'socket_listen.js', | ||
'rockstor.js', | ||
'rockstor_widgets.js', | ||
'rockstor_logger.js', | ||
'paginated_collection.js', | ||
'router.js', | ||
'graph.js', | ||
'd3.slider2.js', | ||
'models/models.js', | ||
'views/common/*.js', | ||
'views/*.js', | ||
'views/pool/**/*.js', | ||
'views/dashboard/*.js' | ||
]; | ||
jsfiles = jsfiles.map(function(element) { | ||
return jssrc + element | ||
}); | ||
|
||
|
||
return gulp.src(jsfiles) | ||
.pipe(eslint('./.eslintrc.js')) | ||
.pipe(eslint.format()) | ||
.pipe(eslint.failAfterError()); | ||
} |