|
|
@@ -4,12 +4,16 @@ module.exports = function( grunt ) {
|
|
|
|
|
|
jshint: {
|
|
|
files: [ '*.js' ],
|
|
|
- options: jshintConfig
|
|
|
+ options: {
|
|
|
+ jshintrc: 'dev/tasks/jshint-config.json'
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
jscs: {
|
|
|
src: '*.js',
|
|
|
- options: jscsConfig
|
|
|
+ options: {
|
|
|
+ config: 'dev/tasks/jscs-config.json'
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
githooks: {
|
|
|
@@ -25,77 +29,3 @@ module.exports = function( grunt ) {
|
|
|
// Default tasks.
|
|
|
grunt.registerTask( 'default', [ 'jshint', 'jscs' ] );
|
|
|
};
|
|
|
-
|
|
|
-// Configurations for JSHint
|
|
|
-var jshintConfig = {
|
|
|
-};
|
|
|
-
|
|
|
-// Configurations for JSCS (JavaScript Code Style checker)
|
|
|
-var jscsConfig = {
|
|
|
- 'excludeFiles': [
|
|
|
- 'node_modules/*'
|
|
|
- ],
|
|
|
- 'requireCurlyBraces': [
|
|
|
- 'if', 'else', 'for', 'while', 'do', 'switch', 'try', 'catch'
|
|
|
- ],
|
|
|
- '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
|
|
|
- },
|
|
|
- 'disallowSpacesInFunctionExpression': {
|
|
|
- 'beforeOpeningRoundBrace': true
|
|
|
- },
|
|
|
- 'requireBlocksOnNewline': true,
|
|
|
- 'requireSpacesInsideObjectBrackets': 'all',
|
|
|
- 'requireSpacesInsideArrayBrackets': 'all',
|
|
|
- 'disallowSpaceAfterObjectKeys': true,
|
|
|
- 'requireCommaBeforeLineBreak': true,
|
|
|
- 'requireOperatorBeforeLineBreak': [
|
|
|
- '?', '=', '+', '-', '/', '*', '==', '===', '!=', '!==', '>', '>=', '<', '<=', '|', '||', '&', '&&', '^', '+=', '*=',
|
|
|
- '-=', '/=', '^='
|
|
|
- ],
|
|
|
- 'requireSpaceBeforeBinaryOperators': [
|
|
|
- '+', '-', '/', '*', '=', '==', '===', '!=', '!==', '>', '>=', '<', '<=', '|', '||', '&', '&&', '^', '+=', '*=', '-=',
|
|
|
- '/=', '^='
|
|
|
- ],
|
|
|
- 'requireSpaceAfterBinaryOperators': [
|
|
|
- '+', '-', '/', '*', '=', '==', '===', '!=', '!==', '>', '>=', '<', '<=', '|', '||', '&', '&&', '^', '+=', '*=', '-=',
|
|
|
- '/=', '^='
|
|
|
- ],
|
|
|
- 'disallowSpaceAfterPrefixUnaryOperators': [
|
|
|
- '++', '--', '+', '-', '~', '!'
|
|
|
- ],
|
|
|
- 'disallowSpaceBeforePostfixUnaryOperators': [
|
|
|
- '++', '--'
|
|
|
- ],
|
|
|
- 'disallowKeywords': [
|
|
|
- 'with'
|
|
|
- ],
|
|
|
- 'validateLineBreaks': 'LF',
|
|
|
- 'validateQuoteMarks': {
|
|
|
- 'mark': '\'',
|
|
|
- 'escape': true
|
|
|
- },
|
|
|
- 'validateIndentation': '\t',
|
|
|
- 'disallowMixedSpacesAndTabs': true,
|
|
|
- 'disallowTrailingWhitespace': true,
|
|
|
- 'disallowKeywordsOnNewLine': [
|
|
|
- 'else', 'catch'
|
|
|
- ],
|
|
|
- 'maximumLineLength': 120,
|
|
|
- 'safeContextKeyword': [
|
|
|
- 'that'
|
|
|
- ],
|
|
|
- 'requireDotNotation': true,
|
|
|
- 'disallowYodaConditions': true
|
|
|
-};
|