--- /dev/null
+{
+ "requireCurlyBraces": [ "if", "else", "for", "while", "do" ],
+ "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return" ],
+ "requireSpacesInFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "disallowSpacesInFunctionExpression": {
+ "beforeOpeningRoundBrace": true
+ },
+ "requireMultipleVarDecl": true,
+ "requireSpacesInsideObjectBrackets": "all",
+ "requireSpacesInsideArrayBrackets": "all",
+ "disallowLeftStickedOperators": [ "?", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ],
+ "disallowRightStickedOperators": [ "?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
+ "requireRightStickedOperators": [ "!" ],
+ "requireLeftStickedOperators": [ "," ],
+ "disallowKeywords": [ "with" ],
+ "disallowMultipleLineBreaks": true,
+ "disallowKeywordsOnNewLine": [ "else" ],
+ "requireLineFeedAtFileEnd": true,
+
+ "excludeFiles": [ "src/intro.js", "src/outro.js" ]
+}
grunt.loadNpmTasks( "grunt-contrib-concat" );
grunt.loadNpmTasks( "grunt-contrib-qunit" );
grunt.loadNpmTasks( "grunt-contrib-csslint" );
+grunt.loadNpmTasks( "grunt-jscs-checker" );
grunt.loadNpmTasks( "grunt-html" );
grunt.loadNpmTasks( "grunt-compare-size" );
grunt.loadNpmTasks( "grunt-git-authors" );
dest: "dist/jquery-ui.css"
}
},
+ jscs: {
+ // datepicker, sortable, resizable and draggable are getting rewritten, ignore until that's done
+ ui: [ "ui/jquery.ui.*.js", "!ui/jquery.ui.datepicker.js", "!ui/jquery.ui.sortable.js", "!ui/jquery.ui.resizable.js", "!ui/jquery.ui.draggable.js" ],
+ // TODO enable this once we have a tool that can help with fixing formatting of existing files
+ // tests: "tests/unit/**/*.js",
+ grunt: "Gruntfile.js"
+ },
uglify: minify,
htmllint: {
// ignore files that contain invalid html, used only for ajax content testing
});
grunt.registerTask( "default", [ "lint", "test" ] );
-grunt.registerTask( "lint", [ "asciilint", "jshint", "csslint", "htmllint" ] );
+grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ] );
grunt.registerTask( "test", [ "qunit" ] );
grunt.registerTask( "sizer", [ "concat:ui", "uglify:main", "compare_size:all" ] );
grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ] );