mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
switch to jscs and jshint with a google style flavor
This commit is contained in:
parent
6a017031c6
commit
b536c15b1d
19
.jscsrc
Normal file
19
.jscsrc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"preset": "google",
|
||||||
|
"fileExtensions": [ ".js" ],
|
||||||
|
|
||||||
|
"requireParenthesesAroundIIFE": true,
|
||||||
|
"maximumLineLength": 120,
|
||||||
|
"validateLineBreaks": "LF",
|
||||||
|
"validateIndentation": 2,
|
||||||
|
|
||||||
|
"disallowKeywords": ["with"],
|
||||||
|
"disallowSpacesInsideObjectBrackets": null,
|
||||||
|
"disallowImplicitTypeConversion": ["string"],
|
||||||
|
|
||||||
|
"safeContextKeyword": "_this",
|
||||||
|
|
||||||
|
"excludeFiles": [
|
||||||
|
"test/data/**"
|
||||||
|
]
|
||||||
|
}
|
13
.jshintrc
Normal file
13
.jshintrc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"node": true,
|
||||||
|
"esnext": true,
|
||||||
|
"bitwise": true,
|
||||||
|
"camelcase": true,
|
||||||
|
"curly": true,
|
||||||
|
"immed": true,
|
||||||
|
"newcap": true,
|
||||||
|
"noarg": true,
|
||||||
|
"undef": true,
|
||||||
|
"unused": "vars",
|
||||||
|
"strict": true
|
||||||
|
}
|
34
gulpfile.js
34
gulpfile.js
@ -1,9 +1,11 @@
|
|||||||
var gulp = require('gulp'),
|
var gulp = require('gulp'),
|
||||||
$ = require('gulp-load-plugins')(),
|
$ = require('gulp-load-plugins')(),
|
||||||
nib = require('nib'),
|
nib = require('nib'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
marked = require('marked'),
|
marked = require('marked'),
|
||||||
karma = require('karma');
|
karma = require('karma'),
|
||||||
|
browserSync = require('browser-sync'),
|
||||||
|
reload = browserSync.reload;
|
||||||
|
|
||||||
gulp.task('default', ['docs', 'build']);
|
gulp.task('default', ['docs', 'build']);
|
||||||
|
|
||||||
@ -18,7 +20,8 @@ gulp.task('watch', ['default'], function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.watch(['elements/**/*.styl', 'elements/**/*.html',
|
gulp.watch(['elements/**/*.styl', 'elements/**/*.html',
|
||||||
'elements/**/*.js', 'gui.html'], ['build']);
|
'elements/**/*.js', 'gui.html'], ['build']);
|
||||||
|
|
||||||
gulp.watch(['README.md', 'docs/*'], ['docs']);
|
gulp.watch(['README.md', 'docs/*'], ['docs']);
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -27,8 +30,8 @@ gulp.task('build', ['vulcanize'], function() {
|
|||||||
|
|
||||||
return gulp.src('build/gui.html')
|
return gulp.src('build/gui.html')
|
||||||
.pipe($.replace(/\\/g, '\\\\'))
|
.pipe($.replace(/\\/g, '\\\\'))
|
||||||
.pipe($.replace(/'/g, "\\'"))
|
.pipe($.replace(/'/g, '\\\''))
|
||||||
.pipe($.replace(/^(.*)$/gm, "'$1',"))
|
.pipe($.replace(/^(.*)$/gm, '\'$1\','))
|
||||||
.pipe($.insert.wrap('document.write([', '].join("\\n"))'))
|
.pipe($.insert.wrap('document.write([', '].join("\\n"))'))
|
||||||
.pipe(rename('gui.js'))
|
.pipe(rename('gui.js'))
|
||||||
.pipe(gulp.dest('build'));
|
.pipe(gulp.dest('build'));
|
||||||
@ -42,16 +45,21 @@ gulp.task('vulcanize', ['css'], function() {
|
|||||||
dest: 'build',
|
dest: 'build',
|
||||||
inline: true,
|
inline: true,
|
||||||
strip: true
|
strip: true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('jscs', function() {
|
||||||
|
return gulp.src('elements/**/*.js')
|
||||||
|
.pipe($.jscs());
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('lint', function() {
|
gulp.task('lint', function() {
|
||||||
return gulp.src('elements/**/*.js')
|
return gulp.src('elements/**/*.js')
|
||||||
//.pipe($.reload({stream: true, once: true}))
|
.pipe(reload({stream: true, once: true}))
|
||||||
.pipe($.gjslint())
|
.pipe($.jshint())
|
||||||
.pipe($.gjslint.reporter('console', {}));
|
.pipe($.jshint.reporter('jshint-stylish'))
|
||||||
//.pipe($.if(!browserSync.active, $.gjslint.reporter('fail')));
|
.pipe($.if(!browserSync.active, $.jshint.reporter('fail')));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('css', function() {
|
gulp.task('css', function() {
|
||||||
|
@ -2,17 +2,22 @@
|
|||||||
"name": "dat.gui",
|
"name": "dat.gui",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"browser-sync": "^1.3.6",
|
||||||
"gulp": "^3.8.7",
|
"gulp": "^3.8.7",
|
||||||
"gulp-clean": "^0.3.1",
|
"gulp-clean": "^0.3.1",
|
||||||
"gulp-gjslint": "^0.1.2",
|
"gulp-if": "^1.2.4",
|
||||||
"gulp-insert": "^0.4.0",
|
"gulp-insert": "^0.4.0",
|
||||||
|
"gulp-jscs": "^1.1.2",
|
||||||
|
"gulp-jshint": "^1.8.4",
|
||||||
"gulp-load-plugins": "^0.6.0",
|
"gulp-load-plugins": "^0.6.0",
|
||||||
"gulp-plates": "0.0.5",
|
"gulp-plates": "0.0.5",
|
||||||
|
"gulp-reload": "0.0.4",
|
||||||
"gulp-rename": "^1.2.0",
|
"gulp-rename": "^1.2.0",
|
||||||
"gulp-replace": "^0.4.0",
|
"gulp-replace": "^0.4.0",
|
||||||
"gulp-stylus": "^1.3.0",
|
"gulp-stylus": "^1.3.0",
|
||||||
"gulp-vulcanize": "^1.0.0",
|
"gulp-vulcanize": "^1.0.0",
|
||||||
"gulp-watch": "^0.6.9",
|
"gulp-watch": "^0.6.9",
|
||||||
|
"jshint-stylish": "^0.4.0",
|
||||||
"karma": "^0.12.23",
|
"karma": "^0.12.23",
|
||||||
"karma-chrome-launcher": "^0.1.4",
|
"karma-chrome-launcher": "^0.1.4",
|
||||||
"karma-jasmine": "^0.1.5",
|
"karma-jasmine": "^0.1.5",
|
||||||
|
Loading…
Reference in New Issue
Block a user