Permalink
Browse files

Use JSCS to check code style.

  • Loading branch information...
1 parent 1b1cbdf commit ef63bb88481f52b321aa19cf5439179d7ca8b7a5 @mikaeljorhult committed Aug 14, 2014
Showing with 79 additions and 2 deletions.
  1. +75 −0 .jscsrc
  2. +3 −2 Gulpfile.js
  3. +1 −0 package.json
View
@@ -0,0 +1,75 @@
+{
+ "validateIndentation": "\t",
+ "disallowMixedSpacesAndTabs": true,
+ "requireSpaceAfterLineComment": true,
+ "disallowNewlineBeforeBlockStatements": true,
+ "requireSpaceAfterKeywords": [
+ "if",
+ "else",
+ "for",
+ "while",
+ "do",
+ "switch",
+ "return",
+ "try",
+ "catch"
+ ],
+ "requireSpaceBeforeBlockStatements": true,
+ "requireParenthesesAroundIIFE": true,
+ "requireSpacesInConditionalExpression": {
+ "afterTest": true,
+ "beforeConsequent": true,
+ "afterConsequent": true,
+ "beforeAlternate": true
+ },
+ "requireSpacesInFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "requireSpacesInAnonymousFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "disallowSpacesInFunctionExpression": {
+ "beforeOpeningRoundBrace": true
+ },
+ "disallowSpacesInAnonymousFunctionExpression": {
+ "beforeOpeningRoundBrace": true
+ },
+ "requireSpacesInNamedFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "disallowSpacesInNamedFunctionExpression": {
+ "beforeOpeningRoundBrace": true
+ },
+ "requireBlocksOnNewline": true,
+ "disallowPaddingNewlinesInBlocks": true,
+ "disallowEmptyBlocks": true,
+ "requireSpacesInsideObjectBrackets": "all",
+ "requireSpacesInsideArrayBrackets": "all",
+ "requireSpacesInsideParentheses": "all",
+ "disallowSpaceAfterObjectKeys": true,
+ "requireCommaBeforeLineBreak": true,
+ "requireOperatorBeforeLineBreak": [
+ "?",
+ "=",
+ "+",
+ "-",
+ "/",
+ "*",
+ "==",
+ "===",
+ "!=",
+ "!==",
+ ">",
+ ">=",
+ "<",
+ "<="
+ ],
+ "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
+ "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
+ "requireSpaceBeforeBinaryOperators": true,
+ "requireSpaceAfterBinaryOperators": true,
+ "disallowMultipleLineBreaks": true,
+ "validateLineBreaks": "LF",
+ "validateQuoteMarks": { "mark": true, "escape": true },
+ "disallowKeywordsOnNewLine": [ "else" ]
+}
View
@@ -1,11 +1,12 @@
var gulp = require( 'gulp' ),
plugins = require( 'gulp-load-plugins' )(),
- files = [ 'main.js', 'package.json', 'modules/*.js', 'nls/**/*.js' ];
+ files = [ 'main.js', 'modules/*.js', 'nls/**/*.js' ];
gulp.task( 'lint', function() {
return gulp.src( files )
.pipe( plugins.jshint() )
- .pipe( plugins.jshint.reporter( 'default' ) );
+ .pipe( plugins.jshint.reporter( 'default' ) )
+ .pipe( plugins.jscs() );
} );
gulp.task( 'default', [ 'lint' ] );
View
@@ -21,6 +21,7 @@
],
"devDependencies": {
"gulp": "^3.8.6",
+ "gulp-jscs": "^1.1.0",
"gulp-jshint": "^1.7.1",
"gulp-load-plugins": "^0.5.3"
}

0 comments on commit ef63bb8

Please sign in to comment.