add gjslint style linter and updated javascript to match

This commit is contained in:
Doug Fritz 2014-09-03 16:33:28 -07:00
parent d3cec69596
commit 7f409799dd
10 changed files with 508 additions and 504 deletions

View File

@ -84,13 +84,13 @@
var args = Array.prototype.slice.apply(arguments);
args.unshift('dat-gui ::');
console.error.apply(console, args);
}
};
Gui.warn = function() {
var args = Array.prototype.slice.apply(arguments);
args.unshift('dat-gui ::');
console.warn.apply(console, args);
}
};
// Old namespaces

View File

@ -50,7 +50,8 @@ Polymer('controller-base', {
listen: function() {
Gui.warn( 'controller.listen() is deprecated. All controllers are listened for free.' );
Gui.warn('controller.listen() is deprecated. ' +
'All controllers are listened for free.');
return this;
},

View File

@ -198,7 +198,8 @@ Polymer( 'controller-number', {
tracky: function(e) {
this._dragFriction = Math.max( 0.01, Math.min( 1, this.map( e.dy, 50, 300, 1, 0.1 ) ) );
this._dragFriction = Math.max(0.01,
Math.min(1, this.map(e.dy, 50, 300, 1, 0.1)));
},

View File

@ -5,7 +5,8 @@ Polymer('gui-panel', {
docked: false,
open: true,
touch: 'ontouchstart' in window || !!window.DocumentTouch && document instanceof DocumentTouch,
touch: ('ontouchstart' in window) ||
(!!window.DocumentTouch && document instanceof DocumentTouch),
ready: function() {
@ -41,7 +42,8 @@ Polymer('gui-panel', {
var value = Path.get(path).getValueFrom(object);
if (value == null || value == undefined) {
return Gui.error( object + ' doesn\'t have a value for path "' + path + '".' );
return Gui.error(object +
' doesn\'t have a value for path "' + path + '".');
}
var args = Array.prototype.slice.call(arguments, 2);
@ -52,7 +54,7 @@ Polymer('gui-panel', {
return Gui.error('Unrecognized type:', value);
}
controller.watch( object, path )
controller.watch(object, path);
controller.init.apply(controller, args);
// Make row
@ -132,9 +134,10 @@ Polymer('gui-panel', {
listenAll: function() {
Gui.warn( 'controller.listenAll() is deprecated. All controllers are listened for free.' );
Gui.warn('controller.listenAll() is deprecated. ' +
'All controllers are listened for free.');
},
}
// todo: domElement

View File

@ -49,9 +49,9 @@ gulp.task('vulcanize', ['css'], function() {
gulp.task('lint', function() {
return gulp.src('elements/**/*.js')
//.pipe($.reload({stream: true, once: true}))
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'));
//.pipe($.if(!browserSync.active, $.jshint.reporter('fail')));
.pipe($.gjslint())
.pipe($.gjslint.reporter('console', {}));
//.pipe($.if(!browserSync.active, $.gjslint.reporter('fail')));
});
gulp.task('css', function() {

View File

@ -4,8 +4,8 @@
"devDependencies": {
"gulp": "^3.8.7",
"gulp-clean": "^0.3.1",
"gulp-gjslint": "^0.1.2",
"gulp-insert": "^0.4.0",
"gulp-jshint": "^1.8.4",
"gulp-load-plugins": "^0.6.0",
"gulp-plates": "0.0.5",
"gulp-rename": "^1.2.0",
@ -13,7 +13,6 @@
"gulp-stylus": "^1.3.0",
"gulp-vulcanize": "^1.0.0",
"gulp-watch": "^0.6.9",
"jshint-stylish": "^0.4.0",
"karma": "^0.12.23",
"karma-chrome-launcher": "^0.1.4",
"karma-jasmine": "^0.1.5",