From a63df3c41d12398daf1c76b5af97deb92e433840 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 9 Mar 2017 23:18:22 +0000 Subject: [PATCH] tidy up some linting files --- .jscsrc | 20 +++++++++++++------- .jshintrc | 3 +++ Gruntfile.js | 16 ++-------------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.jscsrc b/.jscsrc index 16af03e3..58f11080 100644 --- a/.jscsrc +++ b/.jscsrc @@ -2,17 +2,23 @@ "fileExtensions": [ ".js", "jscs" ], "excludeFiles": [ "node_modules/**" ], "validateIndentation": 4, - "requireCurlyBraces": true, + "disallowKeywordsOnNewLine": [], "disallowMixedSpacesAndTabs": true, "disallowMultipleSpaces": {"allowEOLComments": true}, - "disallowKeywordsOnNewLine": [], + "disallowNewlineBeforeBlockStatements": true, + "disallowTabs": true, + "disallowTrailingWhitespace": true, + "requireCurlyBraces": true, //"requireKeywordsOnNewLine": ["else", "catch"], - "requireSpaceBeforeBlockStatements": 1, - //"requireSpaceBeforeObjectValues": false, //"requireSemicolons": true, + //"requireSpaceAfterBinaryOperators": true, + //"requireSpaceAfterComma": {"allExcept": ["trailing"]}, + "requireSpaceAfterKeywords": ["do","for","if","else","switch","case","try","while"], + "requireSpaceBeforeBlockStatements": 1, + "requireSpaceBeforeObjectValues": false, + "requireSpacesInForStatement": true, + "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true }, //"validateParameterSeparator": ", ", //"validateQuoteMarks": false, - "requireSpaceAfterKeywords": ["do","for","if","else","switch","case","try","while"], - "maximumLineLength": 255, - "disallowTabs": true + "maximumLineLength": 220 } diff --git a/.jshintrc b/.jshintrc index db63befe..f03a6dc8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -2,6 +2,9 @@ "asi": true, // allow missing semicolons "curly": true, // require braces "eqnull": true, // ignore ==null + //"eqeqeq": true, // enforce === + "freeze": true, // don't allow override + "indent": 4, // default indent of 4 "forin": true, // require property filtering in "for in" loops "immed": true, // require immediate functions to be wrapped in ( ) "nonbsp": true, // warn on unexpected whitespace breaking chars diff --git a/Gruntfile.js b/Gruntfile.js index fc388087..e516bfc5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,20 +14,7 @@ module.exports = function(grunt) { }, jshint: { options: { - jshintrc:".jshintrc", // Use external file - configured as below... - // http://www.jshint.com/docs/options/ - //"asi": true, // allow missing semicolons - //"curly": true, // require braces - //"eqnull": true, // ignore ==null - //"forin": true, // require property filtering in "for in" loops - //"immed": true, // require immediate functions to be wrapped in ( ) - //"nonbsp": true, // warn on unexpected whitespace breaking chars - ////"strict": true, // commented out for now as it causes 100s of warnings, but want to get there eventually - //"loopfunc": true, // allow functions to be defined in loops - //"sub": true, // don't warn that foo['bar'] should be written as foo.bar - ////"unused": true, // Check for unused functions - ////"forin":false, // turn off check for "for (x in y...)" - //"reporter": require('jshint-stylish') + jshintrc:".jshintrc", // Use external file }, all: { src: ['*/*.js','*/*/*.js'], @@ -53,6 +40,7 @@ module.exports = function(grunt) { options: { config: ".jscsrc", reporter: "inline" + //,fix: true } } });