Skip to content

Instantly share code, notes, and snippets.

@jrcryer
Last active December 14, 2015 20:49
Show Gist options
  • Save jrcryer/5374ea9422ee904cee9a to your computer and use it in GitHub Desktop.
Save jrcryer/5374ea9422ee904cee9a to your computer and use it in GitHub Desktop.
jshint + jscs (jshintignore, jshintrc, jscs)
{
"preset": "google",
"fileExtensions": [".js", "jscs"],
"requireSemicolons": true,
"requireParenthesesAroundIIFE": true,
"maximumLineLength": 120,
"validateLineBreaks": "LF",
"validateIndentation": 4,
"disallowTrailingComma": true,
"disallowUnusedParams": true,
"disallowSpacesInsideObjectBrackets": null,
"disallowImplicitTypeConversion": ["string"],
"safeContextKeyword": "_this",
"jsDoc": {
"checkAnnotations": "closurecompiler",
"checkParamNames": true,
"requireParamTypes": true,
"checkRedundantParams": true,
"checkReturnTypes": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"checkTypes": "capitalizedNativeCase",
"checkRedundantAccess": true,
"requireNewlineAfterDescription": true
},
"excludeFiles": [
"node_modules/**/*.js",
"bad.js",
"Gruntfile.js"
]
}
node_modules/**/*.js
bad.js
Gruntfile.j
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"unused": true,
"node": true,
"-W117": true
}
eval("test");
console.log('test');
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
jscs: {
src: "**/*.js",
options: {
config: ".jscsrc"
}
},
jshint: {
options: {
jshintrc: true
},
uses_defaults: ['**/*.js'],
}
});
grunt.registerTask('default', ['jscs', 'jshint']);
};
{
"name": "projects",
"version": "1.0.0",
"main": "index.js",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.11.3",
"grunt-jscs": "^2.5.0",
"load-grunt-tasks": "^3.3.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment