Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Commit

Permalink
JSCS: Initial Setup
Browse files Browse the repository at this point in the history
Disable all current failures from the jQuery preset
  • Loading branch information
nschonni committed Oct 28, 2014
1 parent 15bb367 commit c9e772a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 9 deletions.
28 changes: 28 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"preset": "jquery",
"validateQuoteMarks": null,
"requireLineFeedAtFileEnd": null,
"disallowKeywordsOnNewLine": null,
"maximumLineLength": null,
"requireDotNotation": null,
"requireMultipleVarDecl": null,
"requireSpacesInAnonymousFunctionExpression": null,
"disallowSpacesInAnonymousFunctionExpression": null,
"requireSpacesInNamedFunctionExpression": null,
"requireSpacesInFunctionExpression": null,
"disallowSpacesInFunctionExpression": null,
"disallowSpaceAfterObjectKeys": null,
"disallowSpaceBeforeBinaryOperators": null,
"requireSpaceBeforeBinaryOperators": null,
"requireSpaceAfterBinaryOperators": null,
"requireSpacesInsideObjectBrackets": null,
"requireSpacesInsideArrayBrackets": null,
"requireParenthesesAroundIIFE": true,
"disallowMultipleLineBreaks": null,
"requireSpaceAfterKeywords": null,
"requireSpaceBeforeBlockStatements":null,
"excludeFiles": [
"dist/**",
"node_modules/**"
]
}
25 changes: 21 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,23 @@ module.exports = function(grunt) {
'convert',
'concat',
'jshint',
'jscs',
'buildTestFilesJson',
'buildGuideline',
'uglify'
],
options: {
spawn: false
}
},
jscs: {
files: [
'.jscsrc',
'src/**/*.js'
],
tasks: [
'jscs'
]
}
},
chmod: {
Expand Down Expand Up @@ -218,21 +228,28 @@ module.exports = function(grunt) {
},
bower: {
install: { }
},
jscs: {
options: {
config: '.jscsrc'
},
files: 'src/**/*.js'
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-chmod');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-convert');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-karma');

// By default, just run tests
grunt.registerTask('default', ['bower:install', 'convert', 'concat', 'jshint', 'buildTestFilesJson', 'buildGuideline', 'compressTestsJson', 'qunit:all', 'karma']);
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@
"devDependencies": {
"bower": "~1.3.9",
"chai": "^1.9.2",
"grunt": "~0.4.1",
"grunt": "^0.4.5",
"grunt-bower-task": "~0.4.0",
"grunt-chmod": "^1.0.3",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "^0.6.0",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-qunit": "~0.2.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-copy": "^0.6.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-chmod": "^1.0.3",
"grunt-convert": "~0.1.5",
"grunt-gh-pages": "~0.8.1",
"grunt-jscs": "^0.8.1",
"grunt-karma": "^0.9.0",
"karma": "^0.12.24",
"karma-chai": "^0.1.0",
Expand Down
3 changes: 2 additions & 1 deletion src/js/core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* jscs: disable */
// Polyfill Function.prototype.bind
// @see https://gist.github.com/dsingleton/1312328
Function.prototype.bind=Function.prototype.bind||function(b){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");}var a=Array.prototype.slice,f=a.call(arguments,1),e=this,c=function(){},d=function(){return e.apply(this instanceof c?this:b||window,f.concat(a.call(arguments)));};c.prototype=this.prototype;d.prototype=new c();return d;};

/* jscs: enable */
"use strict";

$.fn.quail = function(options) {
Expand Down

0 comments on commit c9e772a

Please sign in to comment.