-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include jscs and jshint validation using gulp
- Loading branch information
1 parent
4cbe402
commit d45ae65
Showing
6 changed files
with
173 additions
and
22 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,72 @@ | ||
{ | ||
"esnext": true, | ||
"disallowSpacesInNamedFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowSpacesInFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowSpacesInFunctionDeclaration": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowEmptyBlocks": true, | ||
"disallowSpacesInCallExpression": true, | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"disallowSpaceAfterPrefixUnaryOperators": true, | ||
"disallowSpaceBeforePostfixUnaryOperators": true, | ||
"disallowSpaceBeforeBinaryOperators": [ | ||
"," | ||
], | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"disallowYodaConditions": true, | ||
"disallowKeywords": [ "with" ], | ||
"disallowKeywordsOnNewLine": ["else"], | ||
"disallowMultipleLineBreaks": true, | ||
"disallowMultipleLineStrings": true, | ||
"disallowMultipleVarDecl": true, | ||
"disallowSpaceBeforeComma": true, | ||
"disallowSpaceBeforeSemicolon": true, | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireParenthesesAroundIIFE": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireBlocksOnNewline": 1, | ||
"requireCommaBeforeLineBreak": true, | ||
"requireSpaceBeforeBinaryOperators": true, | ||
"requireSpaceAfterBinaryOperators": true, | ||
"requireCamelCaseOrUpperCaseIdentifiers": true, | ||
"requireCapitalizedConstructors": true, | ||
"requireDotNotation": true, | ||
"requireSpacesInForStatement": true, | ||
"requireSpaceBetweenArguments": true, | ||
"requireCurlyBraces": [ | ||
"do" | ||
], | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"case", | ||
"return", | ||
"try", | ||
"catch", | ||
"typeof" | ||
], | ||
"requirePaddingNewLinesBeforeLineComments": { | ||
"allExcept": "firstAfterCurly" | ||
}, | ||
"requirePaddingNewLinesAfterBlocks": true, | ||
"requireSemicolons": true, | ||
"safeContextKeyword": "_this", | ||
"validateLineBreaks": "LF", | ||
"validateQuoteMarks": "'", | ||
"validateIndentation": "\t" | ||
} |
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,54 @@ | ||
{ | ||
"asi": false, | ||
"bitwise": true, | ||
"boss": false, | ||
"browser": true, | ||
"curly": true, | ||
"debug": false, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
"es3": false, | ||
"esnext": false, | ||
"evil": false, | ||
"expr": false, | ||
"forin": true, | ||
"freeze": true, | ||
"funcscope": false, | ||
"globalstrict": false, | ||
"iterator": false, | ||
"lastsemic": false, | ||
"latedef": "nofunc", | ||
"loopfunc": true, | ||
"maxcomplexity": 11, | ||
"maxdepth": 5, | ||
"maxerr": false, | ||
"maxparams": 10, | ||
"maxstatements": 40, | ||
"moz": false, | ||
"noarg": true, | ||
"node": true, | ||
"nonbsp": true, | ||
"nonew": true, | ||
"notypeof": false, | ||
"noyield": false, | ||
"plusplus": false, | ||
"proto": false, | ||
"scripturl": false, | ||
"shadow": false, | ||
"strict": false, | ||
"supernew": false, | ||
"undef": true, | ||
"unused": false, | ||
"validthis": false, | ||
|
||
"globals": { | ||
"assert": true, | ||
"Platform": true, | ||
"Polymer": true, | ||
"Promise": true, | ||
"suite": true, | ||
"test": true, | ||
"WCT": true, | ||
"ga": 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,15 @@ | ||
'use strict'; | ||
|
||
// Include Gulp & Tools We'll Use | ||
var gulp = require('gulp'); | ||
var $ = require('gulp-load-plugins')(); | ||
|
||
|
||
// Load tasks for web-component-tester | ||
// Adds tasks for `gulp test:local` and `gulp test:remote` | ||
try { require('web-component-tester').gulp.init(gulp); } catch (err) {} | ||
|
||
// Load custom tasks from the `tasks` directory | ||
require('require-dir')('./tasks', { | ||
recurse: 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
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
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,24 @@ | ||
'use strict'; | ||
|
||
// Lint JavaScript | ||
var gulp = require('gulp'); | ||
var $ = require('gulp-load-plugins')(); | ||
var browserSync = require('browser-sync'); | ||
var reload = browserSync.reload; | ||
|
||
gulp.task('jshint', function() { | ||
return gulp.src([ | ||
'**/*.html', | ||
'**/*.js', | ||
'!bower_components/**/*', | ||
'!node_modules/**/*' | ||
]) | ||
.pipe(reload({ | ||
stream: true, | ||
once: true | ||
})) | ||
.pipe($.jshint.extract()) // Extract JS from .html files | ||
.pipe($.jshint()) | ||
.pipe($.jshint.reporter('jshint-stylish')) | ||
.pipe($.if(!browserSync.active, $.jshint.reporter('fail'))); | ||
}); |